Tutorial

How to Migrate Your Website to a New Host

Step-by-step instructions for seamlessly moving your website to a new hosting provider with minimal downtime.

10 min read Updated January 2024

Switching hosting providers doesn't have to be stressful. Whether you're moving for better performance, lower prices, or improved support, this guide walks you through the entire migration process step by step. Most migrations can be completed in a few hours with minimal or zero downtime.

Quick Tip: Use Free Migration

Many hosting providers offer free website migration as part of their plans. Before doing it manually, check if your new host will handle the migration for you. Providers like SiteGround, Hostinger, A2 Hosting, and Cloudways all offer free migration services.

Before You Start: Migration Checklist

Complete these preparation steps before beginning the migration:

  • ☑ Sign up with your new hosting provider
  • ☑ Keep your old hosting account active until migration is confirmed
  • ☑ Note your current DNS settings and nameservers
  • ☑ Lower your DNS TTL to 300 seconds (24–48 hours before migration)
  • ☑ Inform your team about the upcoming migration
  • ☑ Choose a low-traffic time for the switch (evenings/weekends)
  • ☑ Disable caching plugins temporarily (for WordPress sites)
  • ☑ Make a list of all email accounts to migrate

Step 1: Choose and Set Up Your New Host

Before you can migrate, you need an active account with your new hosting provider.

  • Sign up for a hosting plan that meets your site's requirements
  • Set up your account and access the control panel
  • Add your domain to the new hosting account (don't change DNS yet)
  • Note down the new server's IP address, FTP credentials, and nameservers

Important: Do not cancel your old hosting until the migration is fully verified and working.

Step 2: Back Up Everything

Create a complete backup of your entire website from your current host:

Files to Back Up

  • Website files — All files in your public_html or www directory
  • Databases — Export all MySQL/MariaDB databases
  • Email data — Download emails if you're using the host's email service
  • Configuration files — .htaccess, php.ini, and any custom configs
  • SSL certificates — If you have a custom (non-Let's Encrypt) SSL

How to Create Backups

Using cPanel: Go to "Backup" or "Backup Wizard" to create a full account backup. Download the backup file to your computer.

Using FTP: Connect with an FTP client (like FileZilla) and download the entire public_html directory.

Database export: Use phpMyAdmin to export your databases. Select "Quick" export method and "SQL" format.

Backup Best Practice

Always create at least two copies of your backup. Store one locally and one in cloud storage (Google Drive, Dropbox, etc.). This protects against data loss during migration.

Step 3: Transfer Website Files

Upload your website files to the new hosting account using one of these methods:

Method 1: FTP Transfer

The most common method for manual migration:

  • Open your FTP client and connect to the new host using the FTP credentials provided
  • Navigate to the public_html (or www) directory
  • Upload all your website files from the backup
  • Verify file permissions are correct (typically 644 for files, 755 for directories)

Method 2: File Manager

If your new host has cPanel or a similar control panel:

  • Go to File Manager in the control panel
  • Navigate to public_html
  • Upload the compressed backup archive (.zip or .tar.gz)
  • Extract the archive on the server

Method 3: SSH/SCP

For technical users with SSH access:

  • Connect to the new server via SSH
  • Use SCP or rsync to transfer files directly from the old server
  • This is the fastest method for large websites

Step 4: Migrate Databases

If your website uses a database (WordPress, Joomla, Drupal, custom applications), you need to migrate it separately.

Create the Database on the New Host

  • In your new host's control panel, go to MySQL Databases
  • Create a new database with the same name (or note the new name)
  • Create a database user and assign it to the database with all privileges
  • Note the database name, username, and password

Import the Database

  • Open phpMyAdmin on the new host
  • Select the new database
  • Click the "Import" tab
  • Upload the SQL file you exported from the old host
  • Click "Go" to start the import

Update Configuration Files

After importing, update your website's configuration file with the new database credentials:

  • WordPress: Edit wp-config.php and update DB_NAME, DB_USER, DB_PASSWORD, and DB_HOST
  • Joomla: Edit configuration.php
  • Drupal: Edit settings.php
  • Custom PHP: Update your database connection file

Step 5: Configure the Site on the New Host

Before switching DNS, configure everything on the new server:

  • Set up email accounts on the new host (if applicable)
  • Install SSL certificate — Most hosts offer free Let's Encrypt SSL
  • Configure PHP version to match your old server
  • Set up cron jobs if your site relies on scheduled tasks
  • Check .htaccess rules are working correctly
  • Verify file permissions are set correctly

Step 6: Test Thoroughly Before Switching

This is the most important step. Test your site on the new host before changing DNS.

How to Test Without Changing DNS

Method 1: Hosts File Modification

Edit your computer's hosts file to point your domain to the new server's IP address. This lets you view the site on the new host without affecting anyone else.

  • Windows: Edit C:\Windows\System32\drivers\etc\hosts
  • Mac/Linux: Edit /etc/hosts
  • Add a line: [new-server-IP] yourdomain.com

Method 2: Temporary URL

Many hosts provide a temporary URL (like yourdomain.tempurl.host) to access your site before DNS changes.

What to Test

  • ☑ Homepage loads correctly
  • ☑ All internal pages and links work
  • ☑ Images and media files display properly
  • ☑ Forms submit successfully
  • ☑ Database-driven content appears correctly
  • ☑ Email sending and receiving works
  • ☑ SSL certificate is active (HTTPS works)
  • ☑ Login/registration functionality works
  • ☑ E-commerce checkout processes correctly
  • ☑ Site speed is acceptable
  • ☑ Mobile responsiveness works

Step 7: Update DNS Records

Once you've verified everything works, it's time to point your domain to the new host.

Option 1: Change Nameservers

The simplest method. Log in to your domain registrar and update the nameservers to the ones provided by your new host.

  • Go to your domain registrar (GoDaddy, Namecheap, Google Domains, etc.)
  • Find the domain management or DNS settings
  • Replace the old nameservers with the new host's nameservers
  • Save the changes

Option 2: Update A Records

If you want to keep your current nameservers (e.g., for Cloudflare or other DNS management):

  • Log in to your DNS management provider
  • Update the A record to point to the new host's IP address
  • Update the CNAME record for www if needed
  • Update MX records if migrating email

DNS Propagation

After updating DNS, changes take time to propagate globally:

  • If you lowered TTL beforehand: 5–30 minutes
  • Typical propagation: 2–24 hours
  • Full global propagation: Up to 48 hours

During propagation, some visitors may see the old site while others see the new one. This is normal.

Step 8: Post-Migration Tasks

After DNS propagation is complete:

  • Verify SSL is working on the live domain
  • Test all functionality again on the live site
  • Check Google Search Console for any crawl errors
  • Update CDN settings if you use Cloudflare or similar
  • Monitor site performance for the first 48 hours
  • Re-enable caching plugins (WordPress)
  • Remove hosts file entries you added for testing
  • Keep old hosting active for at least 7 days as a safety net
  • Cancel old hosting once you're confident everything works

WordPress-Specific Migration

WordPress sites can be migrated more easily using specialized tools:

Using a Migration Plugin

The easiest method for WordPress sites:

  • All-in-One WP Migration — Free plugin that packages your entire site into a single file. Export from old host, import on new host.
  • Duplicator — Creates a complete package of your site. More control over the migration process.
  • UpdraftPlus — Backup and migration tool. Backup to cloud storage, restore on new host.

WordPress Migration Steps

  • Install WordPress on the new host
  • Install your migration plugin on both old and new sites
  • Export from the old site
  • Import on the new site
  • Update wp-config.php if database credentials changed
  • Test everything, then update DNS

Hosts with Free Migration

Many hosts will migrate your website for free. Take advantage of this to avoid the manual process entirely:

  • SiteGround — Free professional migration via WordPress plugin or manual transfer
  • Hostinger — Free migration for one website with most plans
  • A2 Hosting — Free migration for all new accounts
  • Cloudways — Free migration with their WordPress plugin
  • Bluehost — Offers migration assistance for a fee, free for some plans
  • DreamHost — Free automated WordPress migration plugin

Common Migration Issues

Site Shows "Database Connection Error"

This usually means the database credentials in your config file don't match the new host. Double-check DB_NAME, DB_USER, DB_PASSWORD, and DB_HOST in your configuration file.

Broken Images or Missing Files

File paths may differ between hosts. Check that:

  • All files were transferred completely (compare file counts)
  • File permissions are correct (644 for files, 755 for directories)
  • Hardcoded paths in your database point to the correct location

Email Not Working

If you migrated email hosting too, verify MX records are updated. If using external email (Google Workspace, Microsoft 365), make sure MX records still point to the email provider, not the web host.

SSL Certificate Errors

SSL certificates from the old host won't transfer. Install a new SSL certificate on the new host (usually free with Let's Encrypt). SSL provisioning may require DNS to be pointed to the new server first.

Slow Site After Migration

If your site is slow after migration:

  • Re-enable and configure caching
  • Check that PHP version matches or is newer
  • Verify server location is appropriate for your audience
  • Ensure CDN is properly configured

Looking for a New Host?

Compare the best hosting providers with free migration to make your switch painless.

Compare Top Hosts Hosting Selection Guide

Get Hosting Tips & Deals

Subscribe for hosting migration tips and exclusive deals