I’m a compulsive re-organizer. Every now and then, I just completely re-arrange my office furniture to shake things up. Same goes for my WordPress blog location. Recently, I moved my WordPress blog from oneofmydomains.com/main to blog.anotheroneofmydomains.com. It was relatively easy. But there are some important steps you should remember when moving WordPress sites to a new directory to ensure that you don’t ruin everything. Regardless of whether or not your reasons for migrating a WordPress installation are better than mine, you should follow these steps:
Backing Up Your WordPress Blog Posts
Before you attempt any of the WordPress migration methods, make sure you back up your WordPress blog. If anything goes wrong, you’ll be able to restore the content of your posts from this backup.
Log in to your WordPress dashboard at /wp-admin.
Expand the Tools menu and Click Export.
Choose which data you want to export and Click Download Export File.
Now, if anything goes wrong, you can use the Tools > Import function to restore your old posts. This is the quickest and easiest backup method that only saves the content of your posts—it won’t save your settings, images and custom plugins, etc. For that, you should backup your entire WordPress site.
Move a WordPress Site to a New Directory
Create the directory on your server. You can do this using any FTP client, or cPanel. If you’re creating a subdomain, you should do this ahead of time since it can take a few minutes for the change to take effect.
Log in to your wp-admin dashboard. Expand the Settings menu and Click General.
Change the WordPress address (URL) and Site address (URL) to your new WordPress location.
After you Click Save Changes, you’re going to get an error message. This is normal, because your blog hasn’t been moved yet.
Using a FTP program, move the entire contents of your WordPress directory to the new directory. This includes all the files in the root of your WordPress installation’s current location and subfolders. So, if your WordPress blog is installed at yourdomain.com/blog, move everything in yourdomain.com/blog. If your WordPress blog is located at yourblog.com, move everything in your root and plunk it into the new location you created in step one.
Navigate to your new blog location to verify that it worked.
If so, go ahead and log in to your wp-admin dashboard.
If you use permalinks (which you should), Click Settings and choose Permalinks.
Click Save Changes (you don’t have to change any options) to update your permalink structure.
Click the Media tab in the Settings menu.
Change the path in Store uploads in this folder to your new location. Note: I skipped this step and had no problems, but depending on which plugins you use, you may need to update your upload location.
After that, you should be all set. Note that if you used full paths when embedding images/links in your blog, they may be broken now. But if you used relative paths, such as /wp-content/uploads they should be fine. Either way, you may want to double-check to make sure everything made it over.