Home » Website Hosting » Hosting Migration

How to Migrate Your Website to a New Host: Complete Migration Guide

Migrating your website to a new hosting provider involves backing up your current site, setting up the new hosting environment, transferring all files and databases, testing thoroughly on the new server, and updating your DNS records to point your domain to the new host. The entire process takes 2 to 6 hours of active work plus 24 to 48 hours for DNS propagation. Many hosting providers offer free migration service that handles the technical work for you, making migration far less daunting than most business owners expect.

Before You Start

Schedule your migration during your lowest-traffic period, typically a weekday evening or weekend morning, when temporary issues will affect the fewest visitors. For ecommerce stores, avoid migrating during sales events, product launches, or any period where peak traffic is expected. The migration itself does not cause downtime if done correctly (DNS changes happen seamlessly), but having low traffic during the transition gives you a buffer to catch and fix any issues.

Check whether your new hosting provider offers free migration service. Cloudways, SiteGround, Kinsta, WP Engine, A2 Hosting, and many others will migrate your site from your current host at no charge. Their migration teams handle the file transfer, database import, configuration adjustments, and testing. If free migration is available, use it, these teams migrate hundreds of sites weekly and handle edge cases that can trip up a first-time migration. You are still responsible for DNS changes and final verification.

If you are migrating a WordPress site, migration plugins simplify the entire process. All-in-One WP Migration (free for sites under 512 MB, $69 for unlimited), Duplicator (free for basic sites, $50/year for large sites), and UpdraftPlus (free for backup, $70/year for migration features) package your files and database into a single downloadable file that you upload and restore on the new server. For most WordPress migrations, a plugin reduces the process to two steps: export from the old host and import on the new host.

Step-by-Step Migration Process

Step 1: Create a complete backup of your current site.
Download a full backup of all your website files and your database from your current hosting provider. For files, use your hosting control panel's backup tool, SFTP (using FileZilla or similar), or your hosting's file manager to download everything in your public_html or www directory. For the database, use phpMyAdmin (available in most hosting control panels) to export your database as a SQL file: select your database, click Export, choose the "Quick" method with SQL format, and download the file. For WordPress sites, a migration plugin can create a complete backup (files plus database) in a single package. Store the backup files on your local computer and in a cloud storage service like Google Drive or Dropbox as a safety net. Do not proceed with any other steps until you have confirmed the backup is complete and the files are not corrupted (check file sizes and open the SQL file to verify it contains data).
Step 2: Set up your new hosting account and server environment.
Create your account on the new hosting provider and configure the server. For managed hosting (Cloudways, SiteGround, Kinsta), the provider sets up the server automatically, and you just need to create your application or site through their dashboard. For unmanaged VPS hosting, you need to install and configure the web server, PHP, MySQL, and other required software. Set the PHP version on the new server to match your current server's PHP version (or upgrade if your site is compatible) and verify that any PHP extensions your site requires (like GD, cURL, Imagick, mbstring for WordPress) are installed and enabled. Create a new empty database and database user on the new server, noting the database name, username, and password for the configuration step.
Step 3: Transfer files and database to the new host.
Upload your website files to the new server's web directory (public_html, www, or the application directory specified by your hosting provider). For small to medium sites (under 2 GB), use the file manager in your hosting control panel to upload a compressed archive (.zip or .tar.gz) and extract it on the server, which is much faster than uploading thousands of individual files via SFTP. For larger sites, use SFTP (FileZilla, WinSCP) or command-line tools (rsync, scp) for reliable transfer of large file sets. Import your database by opening phpMyAdmin on the new server, selecting your empty database, clicking Import, and uploading the SQL file you exported in Step 1. For WordPress sites, update the wp-config.php file with the new database name, username, password, and hostname (usually "localhost" on the same server, or a specific hostname for managed database services). If your site uses hardcoded file paths, update them to match the new server's directory structure.
Step 4: Test the site on the new server before changing DNS.
Verify your site works on the new server before pointing your domain to it. Most hosting providers give you a temporary URL (like your-app.cloudways.com, your-site.kinsta.cloud, or your server's IP address) where you can access your site. For WordPress sites, you may need to temporarily update the WordPress Address and Site Address in the database to match the temporary URL for testing, or edit your local computer's hosts file (C:\Windows\System32\drivers\etc\hosts on Windows, /etc/hosts on Mac/Linux) to map your domain to the new server's IP address, which lets you test with your real domain without affecting public DNS. Test thoroughly: check the homepage, interior pages, forms, contact pages, and most critically for ecommerce stores, the entire checkout process including adding items to cart, entering shipping information, and reaching the payment step (do not submit a real transaction). Check that images load correctly, SSL works (padlock icon appears), and page load speed is acceptable.
Step 5: Update DNS and complete the migration.
Once testing confirms everything works on the new server, update your DNS records to point your domain to the new host. Log into your domain registrar (where you registered your domain name) and update either the nameservers (if your new host provides them) or the A record (pointing to the new server's IP address). If you use Cloudflare for DNS, update the A record in your Cloudflare dashboard instead of at the registrar. DNS changes propagate across the internet within 1 to 48 hours, with most visitors seeing the change within 4 to 8 hours. During propagation, some visitors reach the old server and some reach the new one, which is why both servers should have your current site. For ecommerce stores, temporarily pause order processing or add a maintenance notice during the propagation window to prevent orders from being split between two servers. After DNS propagation is complete (verify using online DNS propagation checkers like whatsmydns.net), confirm that your SSL certificate is active on the new server. Keep your old hosting account active for at least 72 hours after migration as a rollback option in case any issues emerge.

WordPress-Specific Migration Tips

Search and replace URLs in the database. WordPress stores the full site URL in the database in thousands of places (post content, widget settings, theme options, serialized data). If your temporary testing URL or the server path differs from your production URL, use the WP-CLI command wp search-replace 'old-url' 'new-url' or the Search Replace DB tool (free, web-based) to update all URL references in the database. This tool handles serialized data correctly, which is important because a simple find-and-replace in the SQL file will corrupt serialized arrays and break your site.

Regenerate permalinks. After migration, go to Settings, Permalinks in the WordPress admin and click "Save Changes" without modifying anything. This regenerates the .htaccess or Nginx rewrite rules that WordPress needs for clean URLs. Skipping this step is the most common cause of "page not found" errors after migration.

Verify cron jobs and scheduled tasks. WordPress uses wp-cron for scheduled tasks like publishing scheduled posts, sending email digests, and running WooCommerce background processes. Some hosting environments require a real server cron job instead of WordPress's built-in wp-cron (which fires on page loads). Check with your new hosting provider's documentation and verify that scheduled tasks are running correctly after migration.

Ecommerce Migration Considerations

Ecommerce store migrations carry additional risk because data changes continuously. Orders placed during migration, customer account changes, and inventory updates on the old server after you copy the database to the new server will be lost unless you account for them. For WooCommerce stores, the safest approach is to put the store in maintenance mode during the final database copy and DNS change, ensuring no orders are placed during the transition. For high-volume stores where even an hour of downtime is unacceptable, coordinate with your new hosting provider's migration team for a staged migration that minimizes the maintenance window to minutes rather than hours.

Verify payment processor integration on the new server. Payment gateways like Stripe and PayPal often use webhook URLs that point to your server for order confirmation callbacks. Verify that webhooks are configured correctly and that test transactions process successfully on the new server before going live. An incorrectly configured payment webhook can result in customers being charged without orders being recorded in your system.

After Migration: Monitoring and Cleanup

Monitor your site closely for the first 72 hours after migration. Check page load times using Google PageSpeed Insights and GTmetrix, verify that forms and email delivery work correctly, monitor your Google Search Console for crawl errors, and watch your analytics for unexpected traffic drops that might indicate pages returning errors. Check your error logs on the new server (accessible through your hosting control panel or at /var/log/ on unmanaged servers) for PHP errors or missing files.

After confirming the migration is stable, cancel your old hosting account (but not your domain registration, which should remain at your registrar). Some hosting providers will refund unused months on your old plan. Update any third-party services that reference your server IP address, including CDN configurations, monitoring tools, and external API integrations.