ThisCalculator

Everyday

How to Migrate from HostGator Without Losing Data

Updated · Standard formula, shown below

How to Migrate from HostGator Without Losing Data

This guide walks you through moving your websites from HostGator to a new hosting provider while keeping every file, database, and email intact. You’ll learn a safe, step-by-step method that works for shared, reseller, and VPS plans, with no downtime and no data loss.

What You’ll Need

  • Access to your current HostGator cPanel (login details)
  • Login details for your new hosting account (cPanel or equivalent)
  • Your domain registrar login (where you bought your domain, often HostGator or Namecheap)
  • An FTP client (like FileZilla) or the file manager in cPanel
  • A text editor to modify configuration files
  • Your current website’s admin credentials (WordPress, etc.)

Step-by-Step

  1. Back up your HostGator site. Log into HostGator cPanel, scroll to the Files section, and open Backup. Click Download a Full Account Backup. Choose Home Directory and MySQL Databases, then generate. This gives you a single .tar.gz file with everything. Alternatively, use the Backup Wizard for a simpler backup of just your home folder and databases.
  2. Download the backup file. Once generated, the backup appears in the Backups section. Click the link to download it to your computer. Keep it safe—this is your safety net.
  3. Set up your new hosting account. Sign up with your new provider and ensure your plan includes cPanel (or an equivalent). Note your new cPanel URL, username, and password. If your new host uses a different control panel (like Plesk), the steps are similar but menu names may differ.
  4. Create the same databases on the new host. In your new cPanel, go to MySQL Databases. Create a database, a user, and assign the user to the database with all privileges. Write down the database name, username, and password—you’ll need them later. If your site uses multiple databases, repeat for each.
  5. Upload your website files. Use an FTP client or the new cPanel’s File Manager to upload the contents of your public_html folder (or the folder where your site lives) from the backup. If you downloaded a full account backup, extract it locally first. Upload everything to the new public_html directory. This may take time depending on site size.
  6. Import your databases. In the new cPanel, open phpMyAdmin. Select your new database, click Import, choose the .sql file from your backup (or from the extracted backup folder), and run it. Repeat for each database.
  7. Update configuration files. For WordPress, edit wp-config.php in the new public_html folder. Change the DB_NAME, DB_USER, and DB_PASSWORD to match the new database credentials you created. For other CMSs, look for a config file (e.g., config.php for Joomla, .env for Laravel) and update the database settings.
  8. Update your domain’s DNS. Log into your domain registrar (where you bought the domain). Find the DNS or Nameserver settings. Replace the HostGator nameservers with the ones provided by your new host (usually in your welcome email or cPanel). If you’re moving to a host that provides a temporary URL, you can test your site there before switching DNS.
  9. Wait for DNS propagation. DNS changes can take 24–48 hours globally, though often faster. During this time, your site may load from either the old or new server. Do not cancel your HostGator account until propagation is complete.
  10. Test your site thoroughly. After DNS propagation, visit your domain and check pages, forms, login, and any dynamic features. Also test email (if you use email hosting) by sending and receiving messages. If something is broken, check the configuration files and database imports.
  11. Cancel your HostGator account. Once everything works and you’re confident, cancel your HostGator plan to avoid further charges. Make sure you have downloaded all backups before canceling.

Common Mistakes

  • Forgetting to update database credentials in config files—this causes “Error establishing a database connection.â€�
  • Uploading files to the wrong directory (e.g., not public_html).
  • Not exporting databases with the correct charset—use UTF-8 to avoid character issues.
  • Changing DNS before testing on the new host—use a temporary URL or hosts file to preview.
  • Ignoring file permissions—some scripts need 755 for folders and 644 for files.
  • Canceling HostGator too early, before DNS propagation completes.

Tips

  • Use a backup plugin (like UpdraftPlus for WordPress) to simplify database and file backup—then restore on the new host.
  • If your site uses email, set up the same email accounts on the new host before switching DNS to avoid losing mail.
  • Keep a copy of your old .htaccess file—it may contain redirects or security rules that need to be copied over.
  • Check for cron jobs in HostGator cPanel and recreate them on the new host.
  • Take advantage of your new host’s free migration service if offered—many providers will move your site for free.

Troubleshooting

  • Site shows “Error establishing a database connectionâ€�: Double-check the database name, user, and password in your config file. Ensure the user has all privileges on the database.
  • Pages look plain or missing CSS: This usually means file paths are broken. Check that the .htaccess file is present and that the site URL is correct in the database (for WordPress, use wp_options table).
  • Email not working: Update the MX records in your DNS to point to your new host’s mail server. Also recreate email accounts and forwarders.
  • Site loads but is slow: Clear caches, and ensure your new host’s PHP version matches what your site needs. You can change PHP version in cPanel.
  • Can’t access admin panel: If using WordPress, reset your password via the database (update user_pass with MD5 hash) or use a one-time login link.
  • Some pages 404: Re-upload the .htaccess file and ensure permalinks are updated (Go to Settings > Permalinks and click Save).

Frequently Asked Questions

  1. Can I migrate without any downtime? Yes, if you keep HostGator active until DNS propagation completes. Your site will be live on the new host once DNS points there, but during propagation some visitors may see the old site. That’s acceptable—no data is lost.
  2. Do I need to move my domain too? No, you can keep your domain at HostGator and just change nameservers. If you want to move the domain registration, that’s a separate process (transfer) and not required for hosting migration.
  3. What about my email accounts? You’ll need to recreate them on the new host. If you want to keep old emails, download them via IMAP before canceling HostGator, then import into the new mailboxes.
  4. Will my WordPress site’s plugins and themes work after migration? Usually yes, as long as the server environment (PHP version, MySQL) meets the requirements. Check your new host’s PHP version and adjust if needed.
  5. How long does the whole process take? The manual backup and upload can take a few hours for large sites. DNS propagation adds 24–48 hours. Overall, plan for 2–3 days.
  6. Is it safe to use a migration plugin? Yes, plugins like Duplicator or All-in-One WP Migration can automate file and database transfer. Just be sure to test the new site before switching DNS.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.