Skip to content

Website migration

What does moving a website from one server to another involve? Is it hard work that needs full focus, or something quick and pleasant? I will try to answer these and a few other questions here.

When we talk about moving a site to a new server, we usually think of the files with its code and other files such as images, PDF documents and other media. In short, files you can simply copy from one server to another, the way you drag files from your computer onto a USB stick. Unfortunately, it is more complicated than that. A lot depends on what kind of website you have.

Static websites

Back in the day most simple websites (company business cards, for example) were static - the server held ready-made files of every page, which the browser downloaded and showed. Their content changed little or not at all between visits. Editing it meant changing the source code files (so calling in a developer), which often made them a pain to maintain. A static site also offered rather little interaction, especially when it came to saving and showing larger amounts of data entered by visitors. A contact form sending its data straight to an email address is the exception, and that is about where the definition of a static site ends. Moving such a site really was just moving its files, and it was not very complicated. It could look like this:

  1. Set up the new server,
  2. Make a copy of the files,
  3. Upload the copy to the new server,
  4. Point the domain to the new server,
  5. Test it, e.g. the key pages and the contact form.

As you can see, it is not a complicated process. Copy the files, change the DNS, "done". Setting up the server is not hard either, because hosting comes with panels such as DirectAdmin, Plesk, cPanel and so on.

Dynamic websites

As the Internet grew and websites offered more and more content, simple sites gave way to solutions that build their pages dynamically from source files. Showing any number of articles kept in a structured database through one template, and editing them at any time (instead of creating a separate file for every page by hand), solved the problems of static sites. It brought in many more technologies, though - not just the database, but also SSL, which gives visitors and their data a certain level of security. Not to mention faster servers, which have to generate all that dynamic content.

With a site like this, moving the files is no longer enough. You have to move the database, adjust the right settings, move the SSL certificate or get a new one, move the email and so on. It starts to sound like a long list of tasks to tick off carefully - and this is only the beginning.

For example, moving the popular WordPress can look like this:

  1. Set up the new server:
    1. Create a place for the files,
    2. Create a database user,
    3. Create the database,
    4. Check whether you can move the old SSL certificate, need to buy a new one, or can use a free one from Let's Encrypt,
    5. Get ready to move the mailboxes - depending on the method, gather the files or settings of the old and the new server.
  2. Make a copy of the files,
  3. Make a copy of the database,
  4. Upload the files to the new server,
  5. Import the database on the new server,
  6. In the "wp_options" table, change the "siteurl" and "home" rows to the current address (so you can test before switching the domain),
  7. Update the database credentials in the WordPress configuration file,
  8. Refresh the security keys in the configuration file*,
  9. Turn on debugging in the configuration file*,
  10. A migration is a good moment to review the installation:
    1. Update WordPress, the plugins and the themes,
    2. Remove the plugins you do not need,
    3. Verify the file checksums*,
    4. Scan the files for malware*.
  11. Test the installation on the new server:
    1. Key pages,
    2. Contact forms,
    3. Checkout paths*.
  12. Get ready to point the domain's DNS to the new server:
    1. Move the old SSL certificate (if you can),
    2. Review the DNS records, including the MX records.
  13. Change the settings from step 6 back,
  14. Change the DNS records,
  15. Repeat step 11.

Compared with moving a static site, you may conclude that without some specialist knowledge you will not get far. You could skip the steps marked with an asterisk, and not every site is a blog and a shop in one, but it is true. Without knowing how the site you are moving is built and what it is made of, you can miss some small piece of configuration that shows up long after the migration.

What is easy to forget

A few things that usually only surface after a migration:

  • DNS time to live (TTL). A day or two before the move, shorten the TTL of your domain's records, for example to 5 minutes. Then the new server address spreads across the Internet quickly instead of over many hours.
  • Email. After changing servers, check the MX, SPF and DKIM records. Without them, messages from your forms and shop can end up in spam or never arrive.
  • SSL certificate. Most hosts now issue a free Let's Encrypt certificate in one click, but usually only once the domain already points to the new server. Plan a few minutes to switch it on.
  • Changed addresses. If you change the structure of your addresses while you are at it (with a new version of your shop, say), prepare 301 redirects from the old addresses to the new ones. How to do it is explained in 301, 410 and noindex redirects, and the redirects generator turns a list of addresses into ready rules. Whether to put them in .htaccess, in PHP or in a plugin is compared in Redirects: .htaccess, PHP or a plugin? After the move, keep an eye on the 404 log for a few weeks.
  • Google Search Console. After the move, look at the pages report and the 404 errors. The search engine will quickly show you what is missing.

Summary

How a website migration goes depends on many things - the technology it is built with, whether it uses outside services that need setting up, and what comes with it, such as email, which has to (or can) move along with the site. The new hosting matters too: its parameters and the support it offers. And do not forget the time the site will be offline. Sometimes the whole operation needs some logistics. For an "ordinary" user, moving a website with all these technicalities and surprises can be a real challenge. Then it is worth turning to the migration service of your host, a specialised company or a freelancer.

Advertisement