# Migrating your WordPress site or WooCommerce shop

> Switching host, merging two sites or migrating an ageing WooCommerce shop isn’t just an export-import job. WordPress data is serialised in the database, which makes a plain text replace in the SQL dangerous unless it’s done with the right tool.

- Source canonique : [https://allaux.fr/en/wordpress-woocommerce/migration](https://allaux.fr/en/wordpress-woocommerce/migration)
- Langue : EN
- Dernière mise à jour : 2026-09-30

## Direct answer

> Copy the files, export the database, then rewrite URLs only with a tool that understands PHP serialisation, such as WP-CLI search-replace or Better Search Replace. A raw SQL UPDATE breaks the declared string lengths inside serialised values in wp_postmeta and wp_options, and theme settings vanish with no error message at all. Then check siteurl and home in wp_options.

## Why a WordPress migration isn’t a simple copy-paste

WordPress stores some of its data (theme settings, plugin configurations, certain custom WooCommerce fields) as serialised PHP data in the MySQL database. Serialised data records the exact length of each string it wraps. If you change the site’s URL with a plain text replace in SQL (via a standard database editor, for example), the declared length no longer matches the new string, and WordPress can no longer read the data correctly: broken theme settings, disappearing widgets, reset plugin options.

That’s why a correct URL replacement goes through a tool that recalculates these lengths, typically the wp search-replace command from WP-CLI, rather than a plain text swap.

On WooCommerce, the migration also needs to check the consistency of the product catalogue, historical orders and customer IDs, as well as the permalink structure, which has to be regenerated after migration to avoid 404 errors on product pages.

## Cases I handle

- Switching host with a site that has to stay accessible without major interruption
- Moving from one domain name to another, or from HTTP to HTTPS
- Merging a brochure site and a WooCommerce shop that were previously separate
- An ageing WordPress site to bring up to date (PHP version, WordPress version, theme)
- Migration from another e-commerce platform to WooCommerce

## How I run a migration

1. **Audit and inventory** — I list the active plugins and the target PHP version, and check each one’s compatibility before starting.
2. **Migration on a test environment** — I make a full copy (files and database) on a test environment, never directly on the live site.
3. **URL replacement with WP-CLI** — I change URLs via wp search-replace, which handles serialised data correctly without corrupting it.
4. **Functional check** — I check the WooCommerce checkout, permalinks, images and forms before sign-off.
5. **Final switch** — I schedule the DNS or server switch for a low-traffic window and carry over any orders placed in the meantime if needed.

## Never use a plain SQL replace to change a URL

> Replacing a URL directly in the database without a tool that handles PHP serialisation silently breaks settings, sometimes in ways that are hard to spot for days.

## Worth reading next

- **Switching WordPress host** — Copying, serialised URLs and the DNS switch, step by step. ([/wordpress-woocommerce/migration/hebergeur-sans-interruption](/wordpress-woocommerce/migration/hebergeur-sans-interruption))
- **Duplicating the site to staging** — Testing a migration before touching production. ([/wordpress-woocommerce/migration/dupliquer-en-preproduction](/wordpress-woocommerce/migration/dupliquer-en-preproduction))
- **Migrating from PrestaShop to WooCommerce** — The case of a platform change, not just a server change. ([/wordpress-woocommerce/migration/prestashop-vers-woocommerce](/wordpress-woocommerce/migration/prestashop-vers-woocommerce))
- **Migrating without losing search rankings** — Redirects and URLs: what gets lost when they’re forgotten. ([/guides/migrer-sans-perdre-referencement](/guides/migrer-sans-perdre-referencement))

## FAQ

### Will I lose orders or customers during the migration?

No, the migration is prepared on a copy of the site. Orders placed between the initial copy and the final switch are carried over so nothing is lost.

### Will the site be down for long?

The actual downtime is usually limited to the DNS or server switch, which can take from a few minutes to a few hours depending on DNS propagation.

### Will my SEO be affected?

If URLs and site structure are kept, the impact is limited. If the domain changes, I set up the necessary redirects to preserve existing rankings.

### What access do I need to give you?

FTP or SSH access on the old and new hosting, database access, and if possible access to the domain name manager for the DNS switch.

### How long does a full migration take?

A simple site migrates in one to two days. A WooCommerce shop with a large catalogue or specific plugins needs more checking, so more likely several days.
