Moving a site between hosts means copying your files, database, and settings to a new server, then pointing your domain at it. A careful plan keeps downtime close to zero.
Back up everything first, copy files and the database, set up the new host, and test before switching. Point the domain last, keep the old host live briefly, then confirm all works.
Why you might move hosts
Developers switch hosts for good reasons. You may have outgrown a shared plan, want SSH and Git the old host lacks, or found a provider with better support and speed. Whatever the cause, a plan makes the move safe.
The main worry is downtime and lost data. Done right, both stay near zero. The trick is preparing fully before you touch the live domain.
Back up everything first
Before anything else, take a full backup. You want copies of your files and your database in a safe place off both servers. If something goes wrong later, you can always restore.
Never start a migration without a fresh backup you have tested. A copy you cannot actually restore is not a backup, so confirm it opens before you rely on it.
- Files. Your code, images, and uploads.
- Database. An export of all your site data.
- Config. Any settings, environment variables, and cron jobs.
Set up the new host
Get the new server ready before you move anything. Install the runtime, create the database, and match the language version to your old setup. Shell access makes this far smoother, so our guide to hosting with SSH access is a useful starting point.
Aim to mirror the old environment closely. The same language version and database type avoid the surprises that appear when the two servers differ.
Copy files and database
With the new host ready, move your data across. Files transfer over SSH or Git, and the database goes over as an export you import on the new server. Git deployment makes the file side clean, and our guide on how to deploy with Git covers a tidy approach.
Update your config for the new server as you go. Database details and any host-specific paths usually change, so check them before you test.
Test before you switch
Never point your domain at the new host until you have tested it. Most hosts let you preview the site on a temporary address or through a hosts-file edit on your own machine. Use that to check everything works.
- Load key pages. Confirm the home page, forms, and any shop work.
- Check the database. Make sure data reads and writes correctly.
- Test features. Try logins, emails, and anything dynamic.
Only move on once the new copy behaves exactly like the live site.
Switch the domain
When you are happy, point your domain at the new host by updating its DNS. The change can take a few hours to spread across the internet, so plan the switch for a quiet period.
Keep the old host running during this window. Some visitors reach the old server until the change fully spreads, so leaving it live avoids any gap.
After the move
Once the domain points to the new host, keep an eye on things for a few days. Check the site loads, forms send, and nothing throws errors. Watch your logs for anything unexpected.
Do not cancel the old plan straight away. Wait until you are certain the new host is stable and the DNS change has spread everywhere. A week is a sensible buffer.
Keeping downtime low
The whole plan is built to avoid downtime. Prepare the new host fully, test before switching, and keep the old one live through the DNS change. Follow that order and visitors barely notice the move.
If you would rather not handle it yourself, many hosts offer free migration. When you compare providers, our roundup of the best hosting for developers flags ones that help with the move, so switching stays painless.
Frequently asked questions
How do I move a site without downtime?
Prepare the new host fully, test it before switching, and keep the old host live during the DNS change. Because the change takes time to spread, running both servers briefly means visitors barely notice the move.
What do I need to back up before moving?
Your files, your database, and your configuration. Take copies to a safe place off both servers and confirm the backup actually restores. A copy you cannot restore is not a real backup.
Why should I test before switching the domain?
Because pointing your domain at a broken copy shows the problem to every visitor. Testing on a temporary address first lets you fix issues in private before anyone reaches the new server.
How long should I keep the old host?
Around a week is sensible. The DNS change takes time to spread, and keeping the old host live avoids a gap. Cancel only once you are sure the new host is stable and everything works.
Can the host move the site for me?
Often yes. Many hosts offer free migration as part of signing up. If you would rather not handle the transfer yourself, look for a provider that includes migration support before you commit.