Transfer Web Hosting Without Downtime: Step-by-Step
This guide walks you through moving a website to a new web host with zero noticeable downtime. You’ll need access to your current hosting control panel, your domain registrar’s DNS settings, and the new host’s account credentials. The process involves copying your files and database, testing everything on the new server, then switching the domain’s DNS records.
What You’ll Need
- Access to your current hosting account (cPanel, Plesk, or similar)
- Login details for the new hosting provider
- Access to your domain registrar’s DNS management (where you bought the domain)
- An FTP client (like FileZilla) or file manager
- A text editor for editing configuration files
- Your website’s database credentials (username, password, database name)
- A way to edit files on your computer (e.g., Notepad++)
Step-by-Step
- Set up the new hosting account. Purchase a plan and create the account. Note the new server’s IP address and nameservers (usually provided in the welcome email).
- Back up your current website. In your old hosting control panel, use the backup tool to create a full backup (files and databases). If not available, download all files via FTP and export your database via phpMyAdmin (as a .sql file).
- Upload files to the new host. Connect to the new server via FTP or use its file manager. Upload all website files to the public_html (or www) directory. Ensure file permissions are correct (folders 755, files 644).
- Import the database. In the new host’s control panel, create a new database and a user with all privileges. Then use phpMyAdmin (or the provided tool) to import your .sql file.
- Update configuration files. Edit your website’s configuration file (e.g., wp-config.php for WordPress, .env for Laravel) to reflect the new database name, username, password, and host (often localhost). Save changes.
- Test the site on the new server. Temporarily edit your computer’s hosts file (on Windows: C:\Windows\System32\drivers\etc\hosts; on Mac/Linux: /etc/hosts) to point your domain to the new server’s IP. Visit your site to check pages, images, and forms. If something breaks, fix it now.
- Update DNS records. Log into your domain registrar. Change the nameservers to the ones provided by your new host. If you’re using an external DNS service (like Cloudflare), update the A record to the new IP instead. DNS changes can take 24-48 hours to propagate globally.
- Wait for propagation. Keep the old hosting active for at least 48 hours. During this time, some visitors may still reach the old server. Do not cancel the old account yet.
- Verify the switch. After 48 hours, check your site from different networks (e.g., using a mobile hotspot). If everything works, you can cancel the old hosting. If not, troubleshoot before canceling.
Common Mistakes
- Forgetting to update configuration files – This is the #1 cause of a broken site after migration. Double-check database credentials and file paths.
- Not testing before switching DNS – Skipping the hosts file test can lead to a broken site for all visitors.
- Canceling old hosting too soon – If DNS propagation is slow, you’ll lose access to your site. Keep the old account for at least a week.
- Ignoring file permissions – Incorrect permissions can cause 500 errors or blank pages.
- Copying files while the site is live – This can result in an incomplete backup. Use a backup tool or pause the site temporarily.
Tips
- Use a migration plugin (like Duplicator or UpdraftPlus for WordPress) if you’re not comfortable with manual steps – they automate most of the process.
- Lower your DNS TTL (Time to Live) to 300 seconds (5 minutes) at least 24 hours before the switch. This speeds up propagation.
- Keep a copy of your backup files on your local computer for extra safety.
- If you have email hosted on the old server, you’ll need to migrate mailboxes or set up new ones on the new host. This is separate from website transfer.
- Take a screenshot of your old server’s settings (PHP version, .htaccess rules) to replicate them on the new host.
Troubleshooting
- Site shows “database connection error� – Check your config file for correct database name, username, and password. Also verify the database host (usually localhost).
- 404 errors after DNS switch – This often means the .htaccess file wasn’t copied or mod_rewrite isn’t enabled. Copy the .htaccess file and enable mod_rewrite in the new host’s Apache settings.
- Blank white page – Check PHP error logs in the new host’s control panel. Common causes: missing PHP extensions, file permission issues, or a syntax error in your config file.
- Site loads but images are broken – Update the site URL in the database (if using WordPress, use a search-replace tool). Also ensure file paths are correct.
- SSL certificate not working – Install a free SSL (Let’s Encrypt) from the new host’s control panel, or re-issue your existing certificate.
- DNS not propagating after 48 hours – Check that you entered the nameservers correctly. Use tools like dnschecker.org to see global status. If stuck, contact your registrar.
Frequently Asked Questions
How long does the transfer take?
The file and database copy can take anywhere from minutes to hours depending on size. DNS propagation is the variable part, usually 24-48 hours, but often faster.
Will I lose email during the transfer?
If you move email hosting, yes, you need to migrate mailboxes. If you keep email on the old host, it will continue to work, but you’ll have two separate systems. Plan accordingly.
What is the hosts file and why do I need to edit it?
The hosts file maps domain names to IP addresses on your computer, overriding DNS. Editing it lets you preview the new site before the public DNS switch.
Can I transfer without any downtime at all?
True zero downtime is impossible because DNS propagation is gradual. However, by keeping both hosts active and switching DNS, you minimize visible downtime to near zero.
Do I need to change my domain nameservers or just the A record?
It depends. If your domain uses the new host’s nameservers, change them. If you use a third-party DNS (like Cloudflare), just update the A record to the new IP.
What if my site uses a custom PHP version or extensions?
Check the new host’s PHP settings and enable the same extensions (e.g., mysqli, curl). You can usually select the PHP version in the control panel.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.