What gets lost in a migration without anyone noticing
RelaunchThe site has moved.
8 min read
By Timo Wessels Published
The site has moved. You open it, and it looks right. Home page there, images there, menu there, footer there.
That is exactly the problem.
A move rarely fails visibly. It fails at five or six things that produce no error message. Nobody misses them until weeks later someone asks why an old link leads nowhere or why a plugin gets no more updates.
This article is not a list of horrors but a checklist for the day after. It rests on my moves with a migration plugin. Where I did not find something in the plugin’s official description, it is marked as my experience.
The most important points first:
- A migration plugin takes the content and the database along, not everything that lies on the server.
- Redirects in the server control file and licences are what get lost most often.
- The check that finds almost everything is a crawl of the new site, looking at the response codes.
Why this happens
Most moves today go through a plugin that packs the website into a single file and unpacks it at the destination. The plugin All-in-One WP Migration describes itself like this: it moves the whole website with database, media files, themes and plugins into a .wpress file. In doing so it adjusts addresses in the database. It also offers a find-and-replace function for that. By hand that is the most error-prone spot of the process.
But the plugin does not say that it takes the whole installation along. In my experience not part of it are: the WordPress core, the central configuration file wp-config.php and the web server’s control file, the .htaccess.
That is right, because these files belong to the environment and not to the website. At the destination there is already a WordPress with its own configuration. Hardly anyone draws the conclusion, though: everything you wrote into these files on the building site is not there at the destination.
The web server’s control file does not travel along
This is the most expensive point on the list, because the redirects hang on it.
If you redirected your old addresses to the new ones with rules in the .htaccess, those rules are gone after the move. The file at the destination is a new one. According to the WordPress handbook, .htaccess is a configuration file that the Apache web server reads per directory. WordPress puts only its basic rules there.
The tricky part: the website works perfectly anyway. Whoever opens the new address notices nothing. Only whoever comes through an old link, from a search engine, a bookmark or another site, lands in nothing. That is exactly the visitor you wanted to protect in the move.
The same goes for the password protection with which you shielded the building site, if it was in this file. It is gone afterwards too. That is handy, but you should know.
Hence: save the address structure once more
This is directly related and is often passed on as superstition: “After the move, save the permalinks once.”
There is no magic behind it. WordPress writes its rules for forming addresses into the .htaccess. The handbook describes: with “Save Changes” on the permalinks screen WordPress writes the rules if the file is writable. The file is newly created and contains only the basic rules, not those of your address structure.
Saving once writes the rules again. Without that, subpages deliver error messages while the home page looks flawless.
The configuration file does not travel along either
It is less noticeable, because rarely does anyone write something visible into it. But when they do, it is mostly something important:
- An error log you switched on for development is gone.
- Security settings you made there are not active at the destination. One example is
DISALLOW_FILE_EDIT. This line blocks the built-in file editor in the WordPress back end. The WordPress handbook shows it in its hardening guide.
The second case is more dangerous because it looks like security and is not.
You log in with the building site’s credentials
Here most people are briefly alarmed.
Before the import, a fresh WordPress with a freshly created account stood at the destination. After the import that account is, in my experience, gone, because the users came from the archive with the database. From now on the credentials of the development environment are valid.
That is logical once you know it, and an unpleasant moment when you do not. Especially if the building site ran with a throwaway password nobody noted down.
Check before the import whether you still have the building site’s credentials. Not after.
What lies outside the content directories stays behind
Everything you put directly into the server’s main directory is not in the archive. The most common case is a custom error page as a static file. If you built one, it still lies on the old server. The version you built still refers internally to the addresses of the building site. So it must not only be uploaded again but regenerated beforehand.
The same goes for verification files that some services expect in the main directory, and for anything else you put there.
Licences still point to the building site
Paid extensions mostly tie their licence to an address. They were activated on the development environment, so on an address that will soon no longer exist.
After the move everything keeps running, because the extension is installed. What stops running are the updates. You do not notice that the next day but in the month a security hole becomes known and the update does not come.
Open every paid extension once after the move and set the licence to the new address. It is dull work and takes ten minutes.
Some page builders have to regenerate their caches
If your site is built with a page builder that generates finished output files from its settings, those files may still point to the old paths after the move.
The result looks broken without being broken: the page loads, but spacing is off or a section is missing. Regenerating in the builder’s settings fixes it. Do not confuse this with a real error and start searching in the content.
Two properties of the import
Check that the archive file is complete. An aborted download or interrupted upload produces a file that looks fine at first glance. You then notice in the middle of the import. The plugin does advertise a format meant to ensure data integrity. Still, do not rely on that but compare the file size before and after the transfer.
Allow for disk space at the destination. The plugin unpacks during the import. In my experience the destination server then needs free space the size of the unpacked website, on top of the archive file. With a large site on a tight plan the process breaks off here. That is no argument against the method. It is an argument against starting the move five minutes before closing time.
The check that finds almost everything
A single check makes most of this list visible: crawl the new site completely once and look at the response codes.
Do not click. Let it run, with a tool that requests every address and writes down what the server answers. Ideally the same answer comes everywhere: all fine (code 200). Anything else is a finding:
- A “not found” answer (404) means that somewhere on your site a link points to an address that no longer exists.
- A redirect within your own site means that an internal link still points to the old address and arrives only by a detour. That works, but is wrong. Internal links should point directly.
You do this crawl twice: once on the building site before switching and once on the finished site afterwards. The second run finds exactly what the move broke.
Add a third check that works differently: request the list of your old addresses. Not the new ones, the old ones. Exactly three answers may come: reachable unchanged, permanently redirected or deliberately deleted. If anything else comes, a redirect is missing. This presupposes that you have a list of your old addresses. If you do not, that is the real finding. There is an article of its own on that.
The order for the day after
- Be able to log in. Keep the building site’s credentials ready before the import starts.
- Save the address structure once more. One click, and the subpages work.
- Restore the redirects. This is the point with real consequences for visitors.
- Crawl the site and correct the internal links found.
- Request the old addresses and add missing redirects.
- Switch the licences.
- Regenerate and upload static files in the main directory.
- Last, look through the configuration file. Was something entered there that belongs back in?
What is unspectacular about this
Nothing on this list is difficult. No point needs special knowledge, and none takes long.
It still fails regularly, because a move counts as done the moment the home page looks right. That is the point where most stop, and where the work begins.
If you have a move behind you and are not sure whether these points were done: the crawl takes a quarter of an hour and answers the question.
Sources
- WordPress.org, All-in-One WP Migration — moves database, media, themes and plugins into a
.wpressfile, find and replace, archive format for data integrity: wordpress.org(external site: wordpress.org) - WordPress.org, Settings Permalinks Screen — “Save Changes” writes the rules into the
.htaccessif it is writable: wordpress.org(external site: wordpress.org) - WordPress Developer Resources, Apache HTTPD / .htaccess — the
.htaccessis a configuration file Apache reads per directory: developer.wordpress.org(external site: developer.wordpress.org) - WordPress Developer Resources, Hardening WordPress —
DISALLOW_FILE_EDITinwp-config.phpblocks the file editor: developer.wordpress.org(external site: developer.wordpress.org) - Own testing practice — what a migration plugin, in my experience, does not take along (
wp-config.php,.htaccess, core), the login with the building site’s data, disk space at the destination, licences, static files in the main directory, page builder caches, the three checks and the order for the day after.