Quick answer
Moving to new hosting without downtime requires preparation: make a backup, transfer files and database, test the site on a temporary address, and only then change DNS. It is crucial that the old hosting remains active until the new one is confirmed to work correctly, including email and SSL.
How to recognize the problem
- Site occasionally or constantly shows error 500 or 503
- Pages load slowly or do not open
- Emails stop arriving or go to spam
- SSL certificate expires or shows a warning
- Site administration (WordPress) does not work or reports a database error
Most common causes
Insufficiently prepared migration
Transferring files and database without prior checking of PHP, MySQL and extension versions can lead to site errors.
DNS change before testing
If DNS records are changed before the new hosting is tested, visitors may see an error or an old version of the site.
Misaligned email and SSL
Mail servers and SSL certificates must be configured on the new hosting before redirecting the domain, otherwise communication will be interrupted.
Forgotten scheduled items
Cron jobs, scheduled tasks and cache may remain on the old hosting and cause inconsistent site behavior.
Step-by-step fix
- 1
Make a complete backup
Make a copy of the site files and database on the old hosting. In cPanel use
BackuporBackup Wizard, and if you use WordPress, you can use a migration plugin. Save the copy locally on your computer as well, not only on the server. - 2
Prepare the new hosting
On the new hosting, set up the hosting account, add the domain as an addon domain or create an account with that domain, and check the PHP and MySQL version. Make sure the required extensions (e.g.
mysqli,curl,gd) are enabled. If needed, create a database and a user with the necessary privileges for that database. - 3
Transfer files and database
Upload the site files to the appropriate directory (e.g.
public_html) via FTP or file manager. Import the database via phpMyAdmin or a migration tool. If the database is large, use the command line or a migration tool. - 4
Configure the site settings
Update
wp-config.php(or the appropriate config file) with the new database details. Check file paths and permissions (e.g.755for directories,644for files). If you use WordPress, temporarily disable cache plugins. - 5
Test the site on a temporary address
Use the temporary URL provided by the hosting (e.g.
http://IP-address/~user) or modify thehostsfile on your computer to temporarily point the domain to the new server, and after testing restore thehostsfile to its previous state. Check that the site loads, that images and links are correct, and that the administration works. Test contact forms and WooCommerce if applicable. - 6
Set up SSL and email
Set up email accounts and prepare MX, SPF, DKIM and DMARC records. The SSL certificate (e.g. Let's Encrypt via cPanel or AutoSSL) can usually be successfully issued only when the domain points to the new server, unless the hosting supports DNS validation. Send a test email to an external address and check that it arrives.
- 7
Change DNS records
At the domain registrar, change the nameservers to those provided by the new hosting or update the A record for the domain and
www. If you change nameservers, first copy all DNS records (MX, SPF, DKIM, DMARC, TXT and subdomains) to the new DNS. Set TTL to a lower value (e.g. 300 seconds) a day earlier to speed up propagation. Wait for the change to propagate (usually 1-24 hours). - 8
Check site operation and redirects
If the SSL certificate has not been issued, run AutoSSL or Let's Encrypt now. Check that the site opens on
https://and thatwwwand the non-wwwversion work correctly. Test all important pages, forms and login. Make sure there is no mixed content and that redirects are correct. - 9
Keep the old copy and monitor
Do not delete the old hosting immediately; keep it for a week as a backup. Monitor access logs and errors on the new hosting. If everything works, you can cancel the old hosting and remove temporary changes.
If the migration does not go smoothly
If the site does not work on the new hosting, revert the DNS records to the old values and wait for propagation. Then review the error logs on the new hosting (e.g. error_log in cPanel) and check that the files and database were transferred correctly. In WordPress you can enable WP_DEBUG in wp-config.php to see error details. If the problem is in the database, check that the tables were imported correctly and that the database user has the appropriate privileges. For larger sites, consider using a migration tool that automatically changes URLs in the database. Always have a backup and a rollback plan.
How to prevent it
- Regularly back up the site and database
- Test the site on a temporary address before DNS changes
- Keep records of DNS records and TTL values
- Check SSL and email settings immediately after migration
When to call a professional
If you have no experience with DNS records, databases, or if the site has many users and functionalities, it is better to leave the migration to an IT expert to avoid longer downtime.
Website development · Fast, SEO-ready, multilingual websitesFAQ
How long does moving to new hosting take?
Transferring files and database usually takes 1-3 hours, while DNS propagation can take up to 24 hours. Total time depends on the site size and TTL values.
Can I avoid site downtime?
Yes, if you prepare the new hosting in advance, test the site on a temporary address and change DNS only when everything works. Keep the old hosting as a backup until you are sure everything is fine.
What happens to emails during migration?
Emails may be temporarily delayed or not arrive if MX records are changed before the new email accounts are set up. Therefore, first set up email on the new hosting, and only then change MX records.