scenerio: I wanted to merge two WordPress sites into one site. One site was live, the other was a backup.
End result: success
This isn’t nearly as hard as some make it out to be. I promise, but only if you are comfortable with the Find/Replace command. It also doesn’t hurt to have a server running on your computer to test it out first, but not necessary.
Things you will need before starting this project:
- Computer with internet access
- Login information from your web provider (not WordPress login) – both sites if different servers
- WordPress plugin: Updraft
- FileZilla or other FTP client installed on your computer
- 7-zip or other file extractor.
- A text file editor Notepad, Scite or Visual Studio Code (not Wordpad, Word, etc)
- Login information for your website provider (not WordPress login info)
- Create a file folder on your desktop for each WordPress site you want to merge
- Read through all of the following instructions before starting with Step 1.
- Patience, this may be time consuming
Step 1: Backup both sites using Updraft if both are live. Always a first step in anything.
Step 2: Log into your site provider’s control panel (site you are merging from), access your database and export it or if you used Updraft to backup that site download the file it created for the database. Move this file into the specific site folder that was created on your desktop for that site.
Step 2: Download all files from your WordPress folders using an FTP server in a separate file on your desktop for each site.
Step 3: Export your WordPress sites using the Export tool in WordPress (will create an .xml file). Place the downloaded .xml file in the same site specific folder from Step 2.
Step 4: Open the .xml file of the site you want to merge from in the text editor. Note the path to the wordpress files. (ie: http://br.net/wp-content…)
Step 5: Using the find/replace command from the file menu, have it find the content of the old url and have it replace it to the merge to site’s address. For example if my old site is http://example.com/wp-content and the site I am merging into is http://newsite.com/wp-content then I want the find to be example.com and the replace to be newsite.com
Step 6: Save this changed .xml either directly to your desktop or rename the file and keep it in the correct site folder on your desktop. The name does not matter as long as it has the .xml extension.
Step 6: On the site you want to merge to, log into your WordPress admin area and use the import tool (probably have to download the import plugin) choosing WordPress as the choice of blog type you are importing.
Step 7: Using the FTP server, upload all the contents of your downloaded WordPress site, not overwriting any of the files currently on your server. Otherwise you will lose all of the posts and other things that are already in that site. This may have to be done folder by folder, item by item. If it is already on the server DO NOT overwrite. Like I said, patience.
Step 8: Once this is done, open the .sql file in a text editor after upzipping it. You may have to upzip the unzipped file depending on the method used to export the database.
Step 9: Repeat the find/replace on this file as you did for the .xml file in Step 5. Save this file with a new name or save it to the desktop. Right click the file (Windows) and choose ‘send to’ and choose zip. We need the file compressed as a zip file to import it.
Step 10: Once that has been completed, access the database on your site provider for the site being merged into. Import the new .sql zip file just created.
Load your site and see all the content is there now.
On a side note: I have a single blog, not a multiuser blog, with my WordPress installation. If you have used different plugins on the sites, then install all the plugins on the merge to website before beginning any of the importing or uploading. The folders created by these plugins need to be in place before doing anything. Some plugins need a database table as well, so always install and activate the plugins first!
Updraft has the capabilities of migrating an existing WordPress installation to another site, but am not sure if it will merge two sites.
If you have any questions, corrections or concerns, please contact me at firstname.lastname@example.org