Custom Permalink and Site Migration

I’ve migrated 10 WordPress sites to new servers or hosting companies in the past 8 days.  It has been a marathon of Cpanel, MYSQL, phpAdmin and a host of exporting and importing options involving direct database Export and Import when possible and WP db backup when not.

Lots of files transferred and moved by FTP.  It’s always great to migrate a site and see it come up on the new site once the DNS records reset and the new home is cozy and ready.

Now to the Permalink issue and Solution

When you migrate a site with all its files and you had a custom permalink on the original there is a extra step that needs to be taken during the migration.

The symptom.  You migrate your site and the home page comes up great and you breath a sigh of relief only to find that it is the only page that will come up.  Everything else is there but it won’t display in the browser.

The issue. When you have a custom permalink ex. %/postname/%  there is a bit of code that is written to the .htaccess file.  When you migrate your site to a new host, that code isn’t in place.

The Solution. Go to Settings Permalinks and change the permalink to “Default” and Save.  Now Change it back to your custom permalink structure.  It will write the code snippet and your site will come up.

One more Note on Custom Permalinks

The permalink is the address listed for your content (pages/posts) in the search engine index.  If you migrate your site and keep the same permalink structure all is fine.  The changing of the DNS record is the change of address card to the world.

But don’t forget that if you had a custom permalink before the move you need that same custom permalink afterward.  Otherwise the search engines will need to re-index all your content.  That could take some time and you could find your site disappearing from the search engines.

The issue I mentioned above most often happens with a MYSQL export and import.  Doing a typical WP backup and restore to a new site will not cause the issue.  But if you had a custom permalink before and you forget and are using the default on the new . . .

Don’t forget to check your permalink structure before you migrate and duplicate it on the new.