How to move WordPress sites

Screen capture of FireFTP client for Mozilla Firefox

Move WordPress?

Move WordPress? Easy? Hard? Many peeps have told me that moving a WordPress site is easy. I’ve always found it challenging. Here’s the “recipe” I’ve come up with for a fairly painless and easy migration from WordPress here, to WordPress there.

Moving WordPress is easy

I’ve seen lots of online resources and had lots of peeps at WordPress Meetups and WordCamps tell me that it’s easy to move WordPress sites. It’s possible that I’m just the lamest WordPress user ever. Or that instead of the gardener’s “green thumb” I have a sort of “digital black thumb.” All I can tell you is that in the past, trying to move WordPress sites has always been painful and always required a lot of touch-ups, link fixing, and so on.

Recently I went through a trial-and-error process to develop this recipe. At least for me, it’s a pain-free and clean way to move WordPress sites.

Move WordPress: Move What to Where?

I am not talking about:

  • Moving from other platforms to WordPress
  • Moving from WordPress to other platforms

I am talking about moving from WordPress to WordPress. Either to move your content to a different URL, or to a different web server. You could also use this recipe to merge content from a WordPress site into another WordPress site.

This is for self-hosted “WordPress.org” sites. It might be similar with hosted “WordPress.com” sites, but I haven’t tried that recently.

cPanel makes it easy

BTW, if you have hosting with cPanel accounts and you’re switching everything over to a different hosting provider, then you don’t even need to move WordPress. In this case you can (or the tech peeps at your new home can) move the whole cPanel, and all your installs will magically be on the new site. All you’ll have to do is repoint your Domain Names to the new destination. But your installations within your cPanel will be unchanged, and the internal addresses, and the locations and names of image files, will all remain the same.

This is very easy. Especially when the tech peeps at your new host do it for you. It’s actually a lot easier than reading the paragraph above.

Recipe to move WordPress sites

OK, so let’s move a site. For example, from https://ideasR.sexy, to https://glenn.zucman.com/blog.

One: Cleanup

Clean up your site: delete extra pages, unused authors, normalize categories, just make everything clean and nice.

move WordPress: screen capture of the WordPress exporter
Step 2: Using the WordPress exporter

Two: Export

WordPress Admin > Tools > Export

move WordPress: screen capture of Adobe Brackets code editor using the find/replace function
Step 3: Using a text editor, Brackets in this case, to find/replace all instances of my old URL with my new URL

Three: Find/Replace

Open your XML export and Find/Replace URLs: I use the Replace All command in Brackets, but you can use any text editor. For my example move, I’d replace all instances of ideasr.sexy with glenn.zucman.com/blog

move WordPress: Screen capture of FireFTP client for Mozilla Firefox
Steps 4 & 5: Using an FTP client, FireFTP for Firefox in this case, to download files from the old site and upload them to the new site

Four: Download Files (images)

Login to your outgoing site via FTP and download all of your files (images). Any FTP client will do, I like the FireFTP plugin for Mozilla Firefox. Download all of oldsite.com/wp-content/uploads. This will be a series of year folders, like “2017” which contain up to 12 month folders, like “11”

Five: Upload Files (images)

Login to your incoming site and reverse the previous step. Now upload all the contents to newsite.com/wp-content/uploads.

move WordPress: screen capture of WordPress Import Tool dialog box
Step 6a: Selecting (installing if necessary) the WordPress Importer
move WordPress: Screen capture of WordPress Importer dialog box
Step 6b: Importing a WordPress XML site export file with the Importer

Six: Import

Go to the WordPress installation at your new site and WP Admin > Tools > Import. If this is your 1st time using the WordPress importer, you’ll first Install the WP Importer, and then Run it. You can assign or add authors as appropriate. You could also have anticipated your author structure before this step, by cleaning up authors at the outgoing site and setting up authors at the new site. For this pass, run the importer with Download and Import File Attachments CHECKED.

Seven: Delete?

Delete all the new posts you just added. I know as you’re reading this step, that you don’t believe me. I know because I don’t even believe me as I’m typing it. All I can say is that in the testing I’ve done, this step is necessary. What Step 6 above seems to do is to set up the Featured Images for all your posts. What Step 8 below seems to do is to set up all the other images for your posts. When I’ve skipped either of these steps, I’ve gotten incomplete posts that need manual touch up. When I follow this (counterintuitive) procedure, I get clean posts where everything works. If you know what’s really going on, a better way to do this, or anything else I don’t understand, please explain it in the comments below!

Eight: Import Again

Run WP Admin > Tools > Import a 2nd time, but this time run the importer with Download and Import File Attachments NOT checked. When this 2nd Import is done, you’re done! At least for me, all my posts, images, and links are in the right place and working.

Move WordPress accomplished!

You did it! I hope! I know the Import > Delete > Import is weird. But it’s the only way I’ve found to get the Importer to actually work for me. LMK if things work or don’t work for you.

Happy Blogging!