Moving the Blog

Five years ago, I installed this WordPress blog in a subdirectory at, imagining that someday I would have some sort of fancy website at, and that this would be nothing more than just a blog.  Since then, I have spent quite a bit of time turning this blog into more than “just a blog.”  About two weeks ago, I finally made the decision to move this blog out of and put it where it belongs, at  The process was relatively simple using just phpMyAdmin, a plain text editor, and an FTP or SFTP client.  There were no problems during the overall process, but the cleanup took a bit longer than expected.  For the benefit of everyone reading this, I’d like to share my process, the problems that I ran in to after the move, and how I eventually resolved them.

The following instructions are Mac-specific using the plain text editor Fraise and the FTP/SFTP client Cyberduck, but they can be easily reinterpreted using any Windows or Linux-based plain text editor and FTP or SFTP client.

  1. Backup your WordPress database. (Never alter the database without a fresh backup on hand.)
  2. Download and install Fraise.
  3. Download and install Cyberduck.
  4. Go to Settings/General in your WordPress admin panel and change the two URL values to the new location.
  5. Export your WordPress database with phpMyAdmin.
  6. Open the .sql file in Fraise.
  7. Navigate to Edit/Find/Advanced Find & Replace, then find and replace all occurrences of “/old-directory” with “/new-directory”, or replace “/old-directory” with a blank field if you’re moving out of the old directory and into the root like I did. (You could make the task more specific by finding and replacing “” with “” etc, but this will only affect absolute URLs and completely ignore relative URLs.)
  8. Save the file and quit Fraise.
  9. Return to your WordPress database via phpMyAdmin.
  10. Check all of the tables and choose “Drop” from the pull-down menu.
  11. Navigate to the Import tab, choose your edited .sql file, and click the Go button.
  12. Access your server via Cyberduck and navigate to the blog’s directory.
  13. Select all of the files and move them to the new directory.
  14. Access your WordPress admin panel at the new location.
  15. Re-save your permalink structure at Settings/Permalinks in the admin panel.
  16. Re-save your upload directory at Settings/Miscellaneous in the admin panel.
  17. Edit (or create) the .htaccess file in your root directory with the following content: “Redirect permanent /old-directory/” or “Redirect permanent /old-directory/” if you moved out of the old directory and into the root like I did.
  18. If you have a sitemap plugin, like Google XML Sitemaps, make sure that the sitemap location is still set correctly and refresh your sitemap.

Everything should be working perfectly.  The whole process should only take a few minutes, but there is going to be some cleanup involved, and that may take a while.

You may notice that in step 7, we used Fraise to easily replace every reference to the old directory with the new directory, or we removed the references altogether.  This is certainly easier than changing everything by hand via the admin panel, but it can be a bit destructive.  For example, I used Fraise to completely remove all references to “/blog”.  This had the desired effect of changing things like “” to “” throughout the entire blog, which saved me the time of hand-editing almost 3,000 instances.  Well, I’m sure some of you remember the Blogroll Dive, and how the links looked like “”.  Unfortunately, they became “”.  Notice the problem?  In order to fix this, I had to re-open the database in Fraise and find and replace all occurrences of “/roll-dive” with “/blogroll-dive”.  This also affected some links to other blogs, but Google Webmaster Tools was kind enough to point out the problems after re-indexing the blog, so I corrected those via the admin panel.

All of that aside, the move went quite well, and the ease of using Fraise to find and replace almost 3,000 references to the old directory far outweighed any time lost during the cleanup afterwards.