Knowledgebase

Migrating a Database to Another Server Print

  • databasesphpmyadmin, databases, database, migration, troubleshooting, domain, cpanel, password, errors
  • 0

Moving between hosts or accounts.

THE PROCEDURE

  1. Export from the source, using the command line for anything large.
  2. Create the database and user on the destination, noting the new prefix.
  3. Import the dump.
  4. Update the application configuration with the new name, user and password.
  5. Update the site URL if the domain changed.

THE PREFIX PROBLEM

Database and user names carry the cPanel username. They will differ between accounts.

The configuration file must be updated, or the site shows a connection error immediately.

This is the most common post-migration failure.

THE TABLE PREFIX

Separate, and it travels with the dump. It does not change.

If the configuration specifies a different table prefix from what the dump contains, nothing works.

CHARACTER SETS

A mismatch between source and destination produces mangled accented characters.

Export and import with matching character sets, usually utf8mb4 on anything modern.

AFTER IMPORTING

Compare the table count against the source Check a sample of content Run a search and replace if the domain changed


Was this answer helpful?
Back

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


Trustpilot