This is standard functionality in Salesforce. Below steps walkthru how to Merge Organizations/Accounts in Salesforce Classic. See this Salesforce Help article on how to merge Accounts in Lighting.
From the home screen navigate to the Organizations tab.
Once on this tab, scroll down to the bottom of the page. Under the Tools, heading navigate to the “Merge Organizations” option.
After clicking the option, you will be prompted to find the organizations you wish to merge. Type the organization’s name in the search bar, and then press “Find Organizations”.
You will then need to select the organization you wish to merge by clicking the checkbox next to the organization’s name. After you finish, press the “Next” button.
The next page will ask you to select the specific values for each field that you would like to retain for the final merged organization. You can combine values from all of the organizations by using the radio button option. Once you finish selecting the values, press the “Merge” button.
You will then see the newly merged organization on the Organization’s tab under the recent organizations.