Export a database and import it somewhere else

Move a MySQL database between hosts or into a new database with phpMyAdmin, handling the errors imports commonly hit.

IntermediateAbout 25 minutes7 steps

What you’ll need

  • phpMyAdmin access on the source
  • DirectAdmin access on Traxio

Whether you’re migrating a site or making a copy for testing, the process is the same: export cleanly, prepare an empty target, import, and update the application.

Steps

  1. Step 1: Export from the source

    In the source phpMyAdmin, select the database, Export → Custom, format SQL, compression gzipped. How to export a database (backup with phpMyAdmin)

  2. Step 2: Check the export

    Confirm the file isn’t tiny. Decompress a copy and look for CREATE TABLE lines.

  3. Step 3: Remove database-specific lines if present

    If the file contains CREATE DATABASE or USE \oldname\``, delete those lines — they point to the old database name.

  4. Step 4: Create the target database

    On Traxio, create a new database and user. How to create a MySQL database in DirectAdmin

  5. Step 5: Import

    Open Extra Features then phpMyAdmin, select the new database first, then Import your file. How to import a database with phpMyAdmin

  6. Step 6: Compare

    Check the table list matches the source, and compare row counts for two or three important tables.

  7. Step 7: Update the application

    Change the database name, user and password in the application’s config file. Host is localhost.

Check it worked

The table count and key row counts match the source, and the application loads data from the new database.

If something goes wrong

What happensWhat to do
Unknown collation utf8mb4_0900_ai_ciReplace with utf8mb4_unicode_ci in the file. MySQL vs MariaDB: what’s the difference?
#1044 access denied to databaseThe file references the old database name; remove CREATE DATABASE/USE lines.
Timeout or file too largeImporting a database that’s too large for phpMyAdmin

This works on any Traxio account. If you’re still choosing a host, PHP and MySQL hosting is free for 30 days, then £0.99 a month.

Popular

Tip: press / to search from any pageSee all results