On this page
Website migrations have a bad reputation. People expect something to break. In my experience they go wrong in a few common ways, and you can avoid almost all of them by planning before you start.
The usual problems are emails still going to the old server for days because nobody lowered the DNS TTL, redirects that were set up on the old server and never copied, a database copied while people were still using the site, and an SSL certificate that was never set up on the new server. This is how I avoid them.
Step 1: list everything the old server does
Do not only think about the website files. The thing you forget is usually what breaks a week later. I make a list of:
- All domains and subdomains, including staging and addon domains.
- Every DNS record. I export the full zone so I can go back if I need to.
- Email accounts, forwarders and autoresponders, with their sizes.
- Cron jobs. These are easy to miss, and nobody notices until a monthly task does not run.
- SSL certificates, and whether any of them are paid certificates.
- The PHP version and the PHP extensions the site needs.
- Redirect rules, wherever they are set up.
- Files outside the website folder, like uploads, generated PDFs or backups.
- Outside services that only accept the old server's IP address, such as a payment gateway.
Step 2: set up and test before changing anything public
I move everything to the new server and test it fully while the old server is still live. If both servers run cPanel, the Transfer Tool in WHM can copy whole accounts, with their files, databases, email and DNS zones.
To test the new server with the real domain name, I add one line to the hosts file on my computer. Then only my computer opens the domain from the new server, while everyone else still sees the old one.
203.0.113.50 example.com www.example.com
Testing with the real domain matters, because many sites behave differently on a different address. I check the home page, logging in, a contact form, the checkout if there is one, the admin area, images, and any scheduled tasks.
Step 3: lower the DNS TTL a few days before
The TTL tells other servers how long to remember your DNS records. If it is 86400 seconds, a change can take up to a day to reach everyone. The same is true if you need to switch back.
So I lower the TTL to 300 seconds at least 48 hours before the move. On the day, DNS changes then reach most people within minutes. About a week after the move, I set it back to a normal value.
Step 4: move email carefully
Email is the riskiest part, because a lost message is gone for good, and often nobody notices for days. The safe order is:
- Create the email accounts on the new server.
- Copy all the old messages across.
- Change the MX records so they point to the new server.
- Copy again, to pick up anything that arrived during the switch.
I keep the old server accepting email for a few days after the MX change. Some sending servers remember the old records for longer than they should, and the last copy brings those messages across.
Step 5: copy the database at a quiet moment
For a small MySQL database, a fresh export during a short maintenance window is enough:
mysqldump --single-transaction --routines --triggers -u user -p dbname > dbname.sql
The --single-transaction option takes a clean copy without locking the tables, so the site stays up during the export. For a large or very busy database, I set up the new database in advance and keep it in sync with the old one. Then the final switch only takes a few seconds.
Step 6: switch over at a quiet time
I pick a time when the site is quiet, often early morning at the weekend, and I make sure someone on the client's side can be reached in case a decision is needed. Then I put the old site in maintenance mode, copy the files and database one last time, update DNS, and test again.
One important rule: do not cancel the old hosting on the same day. I keep it running for at least two weeks. It is your only way back, and it is often where you find the one file everyone forgot.
Step 7: check everything afterwards
- Compare the list of all the site's pages before and after the move, to catch pages that now give a 404 error.
- Check the SSL certificate from outside. On cPanel, AutoSSL issues free certificates once DNS points to the new server.
- Send and receive a test email, and check that SPF and DKIM pass.
- Make sure the cron jobs actually ran.
- Submit the sitemap to Google again and keep an eye on it for a couple of weeks.
- Read the server error logs every day for the first week.
Will I lose my Google rankings?
Moving to a new server on the same domain should not affect your rankings. The addresses and the content stay the same, so there is nothing for Google to react to.

When rankings do drop after a move, it is usually because of a mistake. Pages now give a 404, a "noindex" tag was left over from the staging site, or a robots.txt file copied from staging blocks everything. The before and after page check in step 7 catches these.
If you would rather not do all this yourself, it is exactly what my server and website migration service covers.
Sources
- What is time-to-live (TTL)?, Cloudflare Learning Center cloudflare.com
- Changing your hosting, Google Search Central developers.google.com
