What happens during a website migration?

Files being transferred from one server to another.

Moving a website from one hosting provider to another isn’t as simple as copying a few files and hoping for the best. A successful website migration requires planning, testing and an understanding of how websites actually work behind the scenes.

As a developer, I’ve handled hundreds of website migrations over the years, ranging from simple WordPress brochure websites to large Shopify stores with thousands of products and customer accounts.

When done correctly, a website migration can be completed with little to no downtime. When done incorrectly, it can result in broken websites, missing content and lost enquiries or sales.

In this guide, we’ll cover:

  • What happens during a website migration
  • How to prepare a website for migration
  • Why DNS propagation matters
  • Common migration mistakes to avoid

What is a website migration?

A website migration is the process of moving a website from one hosting environment to another.

This might be because:

  • Your current hosting is too slow
  • You need more server resources
  • You’re changing hosting providers
  • You’re upgrading your infrastructure
  • You’re consolidating multiple websites

Regardless of the reason, every website migration follows the same basic process.

The website files and database are copied to a new server, tested and then connected to the domain once everything is working correctly.

How to prepare a website for migration

Before moving anything, it’s worth checking the website thoroughly and updating any plugins.

Many websites have custom functionality, bespoke integrations or server-specific settings that can easily be overlooked during a migration.

Some common examples include:

  • Custom PHP modules
  • Server configuration rules
  • Additional databases
  • Scheduled cron jobs
  • SMTP email services
  • Third-party integrations

It’s also worth speaking with both hosting providers to understand the current server setup.

Check the current hosting environment

Your new hosting provider should know details such as:

  • PHP version
  • Database version
  • RAM allocation
  • CPU allocation
  • Storage requirements
  • Web server type

While this may sound like a foreign language, matching these settings helps reduce compatibility issues after the migration.

Understanding the two parts of a website

Every website consists of two main components:

Website files

Website files contain everything required to run the website.

This usually includes:

  • Themes
  • Plugins
  • Images
  • Scripts
  • Configuration files
  • Core website files
  • The admin dashboard

It’s essential that these files are exported in a single export rather than divided into multiple files. Downloading them in sections can lead to missing files, and even one missing file can cause significant issues during migration.

There’s a simple phrase you should live by when following this process: “Would you move house by moving your stuff bit by bit in your car, or hire a truck?”

Website database

The database contains the website’s content and settings.

This includes:

  • Pages
  • Blog posts
  • Products
  • Orders
  • Customer accounts
  • Contact form submissions

Without the database, the website has no content.

Most hosting providers allow database exports through their control panel. If you’re unsure how to access it, your hosting provider should be able to assist.

By the end of this stage, you should normally have two compressed files:

  • public_html.zip
  • database.sql.gz

Why you shouldn’t change DNS straight away

One of the biggest mistakes people make is changing DNS records before testing the website. We advise that you keep the domain pointing to the existing hosting while the migration is being prepared.

This allows visitors to continue using the live website while the new hosting environment is being configured and tested.

Changing DNS too early can result in downtime and broken user experiences.

How to upload the website to the new server

Once the new hosting environment is ready, the migration can begin. The first step is creating a new database.

Your hosting provider will usually provide:

  • Database name
  • Database username
  • Database password
  • Database host

Keep these details safe, as they are used to connect the website files to the database.

Importing the database

After creating the database, import the database backup from the old hosting environment. This restores all website content and settings.

Uploading the website files

Next, upload the website files to the root directory of the new hosting account.

Once uploaded, extract the archive so the files sit in the correct location. The website now has its files and data, but it still needs a connection between the two.

How to connect the website to the database

Most websites contain a configuration file that stores database credentials. For WordPress, this is usually:

  • wp-config.php

Other platforms may use:

  • config.php
  • settings.php
  • db.inc

Update the file with the new database credentials. Without this step, the website won’t be able to communicate with the database.

What to test before going live

Testing is one of the most important parts of any website migration. Since we haven’t updated the domain’s DNS records, your domain won’t be pointing to your new website hosting. This is what we want at this stage, as the last thing you want is for people to see a broken website.

Most hosting providers provide:

  • Temporary URLs
  • Development domains
  • Preview links

These are temporary website domains that point to your hosting, which can be used to check that the website is working properly. Check that:

  • Pages load correctly
  • Images display properly
  • Forms work correctly
  • Users can log in
  • Plugins function correctly
  • Orders can be placed

If you can’t identify any errors, are able to log in and everything works as expected, bravo, you migrated a website!

Common website migration errors

If something isn’t working, you’ll often see errors such as:

  • Error Establishing Database Connection
  • PHP Fatal Error
  • White Screen of Death

When this happens, check:

  • Have all files been uploaded?
  • Has the database been imported correctly?
  • Are the database credentials correct?
  • Has anything been missed during extraction?

If everything appears correct, your hosting provider should be able to assist further.

What happens during DNS propagation?

Once testing is complete, it’s time to point the domain at the new hosting provider. This is done by updating the DNS records.

DNS propagation is the period where internet providers around the world update their records and begin sending visitors to the new server.

During propagation:

  • Some users may see the old website
  • Some users may see the new website
  • Email services may take time to update
  • Changes can take up to 24 hours to fully complete

A simple way to check propagation

One trick I often use is placing a small piece of text somewhere on the new website, such as the footer.

This could be:

  • New Server
  • Migration Complete
  • A random word only you know about

Once you start seeing that text on the live domain, you’ll know traffic is reaching the new server. After propagation is complete, simply remove it.

Key takeaways for a successful website migration

Website migrations don’t need to be stressful.

The key is preparation, testing and avoiding DNS changes until you’re confident everything is working correctly.

By understanding how files, databases and DNS propagation work together, you can significantly reduce the risk of downtime and migration issues.

As someone who has completed hundreds of website migrations, I know how quickly things can go wrong when steps are skipped. Taking a methodical approach makes all the difference.

For further reading on website migrations, check out:

Need help with a website migration?

While website migrations follow a logical process, unexpected server conflicts can quickly disrupt your business operations. If you would prefer to leave the technical heavy lifting to the experts, we can help.

At Trio Media, we regularly migrate WordPress and bespoke websites between hosting providers with minimal downtime.

Get in touch today!

Like what you read? Share this post
Latest posts
AI Marketing Paid Media
Marketing AI SEO Website