Guide Migrations & Transfers

How to migrate a WooCommerce store

A store keeps taking orders while you migrate, so the real challenge is not losing any of them during the handover.

Updated 12 min read Intermediate

A WooCommerce migration follows the same rules as any other website move — copy first, test second, switch DNS last — with one extra complication: a store does not stop taking orders while you work. Every step below is built around that fact, because the risk in a store migration is not usually a broken page, it is a customer's order landing on the server you are about to switch away from.

Before you start: what a store adds to the usual list

  • The uploads folder — product images and any downloadable products live here, and it can be large enough that it is easy to assume a plugin exporter has included it when it has not.
  • Payment gateway settings — API keys for Stripe, PayPal or similar are stored in the database, but some gateways also whitelist the server's IP address, which changes with the move.
  • Stock levels and orders that keep changing right up until the moment you switch.
  • Scheduled tasks such as abandoned-cart emails or stock synchronisation, which run via WP-Cron or a real cron job and do not travel with a plain file copy.

Step 1 — Back up everything, including uploads

Export the WordPress files, the database, and specifically confirm the wp-content/uploads folder is included — it holds every product image and is the single most common thing left behind in a rushed store migration.

Step 2 — Prepare the new hosting account

Set the domain up on the new host, create an empty database and user, and match the PHP version WooCommerce is currently running on. A version mismatch on a store is worse than on a brochure site, because checkout code paths tend to be the first thing a PHP version change affects.

Step 3 — Copy files and database

Upload the WordPress files into the new web root and import the database export:

mysql -u newuser -p newdatabase < backup.sql

Then update wp-config.php with the new database name, user, password and host so WordPress knows where to find it.

Step 4 — Test the entire buying journey privately

Add an entry to your own computer's hosts file pointing the domain at the new server, using the IP address shown in your new host's control panel — see previewing a site with your hosts file for the exact steps. With it active, only your machine sees the new server while customers keep buying from the old one uninterrupted.

Work through the full journey, not just the home page:

  • Browse a category, view a product, and check the images load.
  • Add to basket and reach the cart page with the correct totals.
  • Complete checkout using a payment gateway's test mode if it has one.
  • Confirm the order confirmation email actually arrives.
  • Log into "my account" and check order history displays correctly.
Payment gateways can behave differently on a new server

Some gateways restrict API access by server IP address. If checkout fails only on the new server with an authentication-style error from the payment provider, check whether the new server's IP needs adding to an allowlist in the gateway's dashboard before you switch DNS.

Step 5 — Take a final export immediately before switching

This is the step that is specific to a store. Between your first database export and the moment you actually switch DNS, real customers may have placed real orders on the old site. Right before switching, export the database again — or at minimum the wp_posts, wp_postmeta and wp_woocommerce_order_items tables that hold order data — and import that fresher copy over the top on the new server.

Step 6 — Switch DNS and reconcile

Lower the TTL a day ahead if you have not already, then switch the nameservers or A record and remove the hosts file entry. For an hour or two afterwards, keep an eye on both servers: some visitors will still reach the old one until DNS finishes spreading. If any order appears on the old server after the final export, add it manually on the new site so nothing gets lost.

Do not cancel the old hosting for a week

The same rule applies here as with any migration, with slightly higher stakes: a customer whose network is still resolving to the old server should still be able to complete a purchase there rather than finding nothing at all. Keep the old account running for about a week, watching for any stray order, before you take a final backup and close it.

SEO and product pages

Provided product and category URLs do not change as part of the move, migrating host does not itself affect search rankings — see will changing host hurt my search rankings. If you are restructuring URLs at the same time as migrating, that is a separate project and worth doing after the migration has settled, not during it.

We can migrate a store for you

Website migration, including WooCommerce stores, is included free with our hosting plans. Send us your current host's details and we will handle the copy, the testing, and the timing of the switch.

Related reading