TechBuzzPro

Migrate WooCommerce Store to New Host Without Losing Orders

· 6 min read · Apps & Browsers

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Moving a WooCommerce store to a new host can feel risky, especially when you're worried about losing order history, customer data, and product records. This guide walks you through a safe migration that preserves every order, customer, and setting. You'll back up your site, transfer files and database, update URLs, and verify everything works before going live. No technical expertise beyond following steps is required, but you'll need access to both your old and new hosting control panels and FTP or file manager tools.

What You'll Need

  • Access to your current hosting control panel (cPanel, Plesk, or custom) and file manager or FTP credentials.
  • Access to your new hosting account with a database created and credentials ready.
  • A domain name you control (to update DNS if needed).
  • An FTP client (like FileZilla) or your host's file manager.
  • A text editor (like Notepad++) for editing configuration files.
  • Your WordPress admin login for both old and new sites.
  • A backup plugin (optional but recommended, e.g., UpdraftPlus) or phpMyAdmin access.

Step-by-Step

  1. Back up your entire site. In your WordPress admin, go to Plugins > Add New and install a backup plugin like UpdraftPlus. Run a full backup (files + database) and download the backup files to your computer. Alternatively, use your hosting control panel's backup feature to create a full site backup. Make sure the backup includes the wp-content folder and the entire database.
  2. Export your database. If you didn't use a plugin, open phpMyAdmin in your old host, select your WordPress database, and click Export. Choose the “Quick” method and SQL format, then download the file. This contains all orders, customers, and product data.
  3. Download all files. Using FTP or your old host's file manager, download the entire WordPress directory (usually public_html or www) to your computer. This includes themes, plugins, uploads, and the wp-config.php file. If you used a backup plugin, you can skip this step as the backup already includes files.
  4. Create a database on the new host. Log into your new hosting control panel, find “MySQL Databases” (or similar), create a new database, a database user, and assign the user to the database with all privileges. Note the database name, username, and password – you'll need them.
  5. Upload files to the new host. Connect to your new host via FTP or use its file manager. Upload all the WordPress files you downloaded into the appropriate directory (usually public_html). If you used a backup plugin, extract the backup files into that directory.
  6. Import the database. In the new host's phpMyAdmin, select your new database, click Import, choose the SQL file you exported earlier, and run it. This will recreate all your tables, including orders and customer data.
  7. Update wp-config.php. Open the wp-config.php file in a text editor. Replace the DB_NAME, DB_USER, DB_PASSWORD, and DB_HOST constants with the credentials from your new database. Save and upload the file back if you edited locally.
  8. Check for hardcoded URLs. In your database, there may be URLs pointing to your old domain. You can update them later, but for now, test the site with a temporary URL or hosts file edit. If you're moving to a new domain, you'll need to do a search-replace (see Tips).
  9. Test the site on the new host. Before changing DNS, you can preview the site by editing your local hosts file (on your computer) to point your domain to the new server's IP. Or use a temporary URL provided by your host. Log into wp-admin, check that orders appear under WooCommerce > Orders, and test a few pages.
  10. Update DNS and go live. Once everything works, update your domain's nameservers or A record to point to the new host. DNS propagation can take a few hours to 48 hours. After propagation, your site will load from the new host.
  11. Final verification. After DNS is live, clear your browser cache, log into wp-admin, and check that all orders, customers, and products are intact. Test the checkout process (use a sandbox payment gateway) to ensure everything works. Also, verify that all images and links load correctly.

Common Mistakes

  • Forgetting to update wp-config.php: This is the most common error. If the database credentials are wrong, you'll get a “Error establishing a database connection.”
  • Not updating URLs: If you move to a new domain, leaving old URLs in the database will break links and images. You must perform a search-replace on the database.
  • Copying files while the old site is live: This can result in an inconsistent backup. Always take a backup when the site is idle or use a plugin that handles this.
  • Skipping the test phase: Going live without testing can lead to broken pages and lost revenue. Always test thoroughly first.
  • Ignoring file permissions: Incorrect file permissions can cause errors. Ensure directories are 755 and files are 644.

Tips

  • Use a migration plugin: Plugins like Duplicator or All-in-One WP Migration can automate much of the process, including URL replacement. They're reliable for beginners.
  • Search-replace URLs correctly: If changing domain, use a tool like “Better Search Replace” plugin or WP-CLI to update URLs in the database. Never use a simple find/replace in a text editor on the SQL file, as it can corrupt serialized data.
  • Keep the old site active until DNS propagates: This ensures visitors aren't hit with downtime. You can also set up a maintenance page on the old site.
  • Check payment gateway webhooks: After migration, update your payment gateway (like PayPal or Stripe) with the new site's URL so transaction notifications work.
  • Test email sending: Your new host may have different SMTP settings. Test WooCommerce emails to ensure order notifications are sent.
  • Update any cron jobs: If you had scheduled tasks, recreate them on the new host.

Troubleshooting

  • Error establishing database connection: Double-check the database name, user, password, and host in wp-config.php. Sometimes the host is localhost, but some hosts use a different hostname.
  • 404 errors on pages: This often happens due to permalink issues. Go to Settings > Permalinks in wp-admin and click “Save Changes” to flush rewrite rules.
  • Missing images: If images aren't loading, the file paths in the database may still point to the old domain. Perform a search-replace for the old domain with the new one.
  • White screen of death: This is usually a PHP error. Enable WP_DEBUG in wp-config.php to see the error message. Common fixes include increasing memory limit or deactivating a problematic plugin via FTP (rename the plugin folder).
  • Orders missing: If orders are missing, the database import may have failed. Re-import the SQL file carefully, ensuring no errors. Also, check that the WooCommerce tables (like wp_woocommerce_order_items) exist.
  • Cannot log into wp-admin: This could be due to a plugin conflict or cookie issue. Try clearing your browser cookies, or if the site is on a temporary URL, you may need to update the siteurl and home options in the database via phpMyAdmin.

Frequently Asked Questions

Will my customers' passwords still work after migration?

Yes, passwords are stored hashed in the database, so they remain valid. No need to reset them.

Do I need to move the SSL certificate?

Yes, if you use HTTPS, you'll need to install an SSL certificate on the new host. Most hosts offer free Let's Encrypt certificates.

Can I migrate without downtime?

Yes, by keeping the old site live until DNS propagates, you can minimize downtime. However, there may be a brief period where changes made on the old site are lost. To avoid this, put the old site in maintenance mode during the final sync.

What about my email accounts?

Email accounts are separate from your website. You'll need to recreate them on the new host and update your mail client settings.

How long does DNS propagation take?

It can take from a few hours up to 48 hours, though it's often faster. During this time, some visitors may see the old site and some the new one.

Should I delete the old hosting account?

Wait at least a week after the migration to ensure everything works. Then, you can cancel the old account, but keep a backup of your site in case you need to roll back.