Migrating your website to a new hosting provider can feel intimidating, but following a structured process eliminates the risk of data loss and downtime.
Here is the definitive step-by-step guide to moving your website safely.
Step 1: Purchase Your New Hosting Plan
Do not cancel your old hosting service yet. Your website must remain completely live and functional at your old host throughout the entire migration process to guarantee zero downtime. [5, 6]
- Set Up the Account: Complete the registration with your new provider.
- Locate Server Details: Find your new server IP address, temporary URL, and FTP/SSH login credentials in your welcome email or dashboard.
- Skip Domain Assignment: If the host asks to point your domain name immediately, select “I will update my nameservers later.”
Step 2: Download a Full Website Backup
You need a complete snapshot of your website from your old host. A website consists of two distinct components: your files and your database.
1. Download Website Files
- Log into your old hosting control panel (e.g., cPanel).
- Open the File Manager and navigate to the
public_htmldirectory. - Compress (zip) all files and folders.
- Download the
.zipfile directly to your local computer using the browser or an FTP client like FileZilla.
2. Export the Database
- In your old control panel, open phpMyAdmin.
- Select your website’s database from the left-hand sidebar.
- Click the Export tab at the top.
- Choose the Quick export method and click Go to download the
.sqlfile.
Step 3: Move Files and Database to the New Host
Now you will replicate your website’s architecture inside your new hosting account.
1. Upload Website Files
- Log into your new hosting control panel.
- Open the File Manager or connect via FTP using your new credentials.
- Upload your downloaded
.zipfile into the newpublic_html(or equivalent root) folder. - Extract the compressed files inside that directory.
2. Create and Import the Database
- In your new control panel, navigate to MySQL Database Wizard.
- Create a brand new database and write down the Database Name.
- Create a new database user, assign a highly secure password, and write down the User Name and Password.
- Grant All Privileges to link that user to the new database.
- Open your new host’s phpMyAdmin, select your newly created database, click the Import tab, choose your
.sqlfile, and click Go.
Step 4: Update Configuration Files
Because your database name, username, and password have changed, your website files need to be told how to connect to the new database.
- Locate your application’s configuration file (e.g.,
wp-config.phpfor WordPress orconfiguration.phpfor Joomla) via the new File Manager. - Edit the file and update the following lines with your new database credentials:
- Database Name (
DB_NAME) - Database User (
DB_USER) - Database Password (
DB_PASSWORD) - Database Host (
DB_HOST— usually remainslocalhost)
- Database Name (
- Save the changes.
Step 5: Test the Migration via Temporary URL
Before telling the rest of the world to look at your new server, you must verify that the site works perfectly.
- Locate Temporary URL: Most hosts provide a preview link (e.g.) h
ttp://your-server-ip/~username). - Alternative (Hosts File): If a temporary URL is not available, you can trick your personal computer into viewing the new server by editing your computer’s local
hostsfile. Map your domain name directly to your new server IP address. - Inspect the Site: Browse your pages, test forms, and click links to ensure no assets or styling rules are broken.
Step 6: Update Your DNS Records
Once you are 100% confident the migrated site is working, you need to route global traffic to the new server.
- Log into the registrar where you purchased your domain name (e.g., Namecheap, GoDaddy, or Enom).
- Locate your DNS Zone Editor or Nameserver Settings.
- Method A (Recommended): Update the Nameservers (NS records) to point directly to the nameservers provided by your new host.
- Method B: If you use an external DNS manager like Cloudflare, simply edit the A Record to point your root domain to the new server’s IP address.
⚠️ Crucial Note: DNS changes take anywhere from 2 to 48 hours to update worldwide. During this propagation window, some global visitors will hit your old server while others hit the new one. Keep both hosting accounts completely active during this time.
Step 7: Cancel Your Old Hosting Account
Monitor your traffic logs on the new server. Once 48 hours have passed and global traffic is routing smoothly to the new host, you can safely close your old hosting account.