Several months back we made the decision to merge TimePanel’s blog into our company’s blog here at solutionfactor.net. Fortunately it was a breeze thanks to native support within WordPress to do so. Here’s how we did it; hopefully this saves readers some time if they’re looking to do something similar.
Step 1: Backups
Backups are always a good idea, especially in cases like this where data will go through changes that you may want to revert, either due to unexpected error, or just b/c you change your mind at some point.
You can backup both site’s files easily using cp to copy files to a backup directory:
sudo cp -r blog_1_directory/ blog_1_backup/ sudo cp -r blog_2_directory/ blog_2_backup/
… and for the databases, a vanilla mysqldump handles the job:
sudo mysqldump -u -p blog_1_database > blog_1_database.sql sudo mysqldump -u -p blog_2_database > blog_2_database.sql
Step 2: Export The Source Blog
Next up is exporting the source blog. By source blog, I mean the blog you’re exporting data from. By contrast, I’ll refer to the target blog (later) as the blog you want to import data into.
Log into the source blog and go to Tools > Export. From there, select to export All content (it’s probably selected by default), then click Download Export File.
Step 3: Import Into The Target Blog
With the source data exported, next up is to import the data into the target blog. To do so, log into the target blog and go to Settings > Import.
From there, you’ll see an option to install an import tool; select the WordPress tool at the bottom of the list.
Once installed, run it. You’ll see an option to create a new author for the imported posts, or assign to an existing author. In our case, we chose the latter, but choose the option that best suits you.
And that should be it. Once the import tool completes, you should see all your blog posts on the new blog.
Step 4: 301 Redirects
If you’re planning on removing the old blog posts once they’ve been imported into the target site, you’ll want to add 301 redirects to inform search engines the content has moved. Otherwise, the old content will produce 404 errors once it’s gone, which can lead to SEO penalties.
Fortunately it’s an easy change to make. You can add the following redirect to your vhost or .htaccess file:
redirect 301 [old blog url] [new blog url]
In our case, that translated to the following:
redirect 301 /blog http://solutionfactor.net/blog/