Knowledgebase

Importing and Exporting Databases Efficiently Print

  • developersgitdeployment, developers, database, phpmyadmin, php, errors, uploads, redirects
  • 0

Moving data without timeouts.

EXPORTING

mysqldump produces a SQL file containing structure and data. Redirect it to a file.

Compressing the output as it is written saves considerable space and transfer time on large databases.

IMPORTING

Feed the SQL file into the mysql client. For a compressed dump, decompress on the fly.

WHY NOT PHPMYADMIN FOR LARGE DATABASES

It runs through PHP and is subject to upload size limits and execution time limits. Large imports time out partway, leaving an incomplete database, which is worse than failing outright.

The command line has neither limit.

IF YOU HAVE NO SSH ACCESS

Split the dump into smaller files and import them in sequence, or ask us to import it for you.

BEFORE IMPORTING

If replacing an existing database, drop the existing tables first. Importing over existing data produces conflicts and partial results.

AFTERWARDS

Verify row counts against the source, and check the application connects.

FOR REPEATED TRANSFERS

Script it. A dump, transfer and import in one command removes the opportunity for error.


Was this answer helpful?
Back

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


Trustpilot