Knowledgebase

Moving a Site Between Domains Print

  • databasesphpmyadmin, databases, database, domain, plugins, woocommerce, wordpress, permalinks, caching, redirects
  • 0

Updating the database for a new address.

THE STEPS

  1. Back up the database.
  2. Update the site URL values.
  3. Run a serialisation-aware search and replace across the whole database.
  4. Clear caches.
  5. Re-save permalinks.
  6. Check a sample of pages, images and links.

WHAT TO REPLACE

The full old URL including scheme, to the full new one.

Also check for references without the scheme, and for the bare domain.

WHY A PLAIN SQL REPLACE FAILS

Serialised data records the length of each stored string. Changing the text without updating the lengths corrupts the value.

Widget settings and plugin configuration are commonly stored this way, and they fail silently.

THE TOOLS THAT WORK

A search-replace plugin that handles serialisation

WP-CLI

A dedicated search-replace script

CHECKING AFTERWARDS

Search the database for the old domain. Anything remaining is somewhere the tool did not reach, typically a configuration file rather than the database.

THE SEO SIDE

Every old URL needs a 301 redirect to its new equivalent, or the search traffic is lost.


Was this answer helpful?
Back

Are you happy with your experience? Leave us a review on Trustpilot.


Trustpilot