Our new customer portal is now live!
Guides

Export and import a database with phpMyAdmin

Save an SQL copy or import a database into a separate, verified destination.

7 min · Intermediate

Updated

In this guide

Identify the correct database

Check the database name in your application's configuration. In WordPress, it is the DB_NAME setting in wp-config.php. Do not share the other credentials or passwords in that file.

A database export contains database content, but not website images, themes or other files. Back those up separately when needed.

Export an SQL file

  1. Open phpMyAdmin in cPanel and select the correct database on the left.
  2. Open Export. For an ordinary whole-database export, select Quick and SQL format.
  3. Start the export and save the completed file securely.
  4. Check that the download finished and the file is not empty.

Import a database

  1. Preferably create a new, empty destination database using cPanel's Database Wizard.
  2. Open that database in phpMyAdmin. Double-check its name.
  3. Select Import, the SQL file and the character set matching the export. Keep appropriate defaults unless the application's instructions require otherwise.
  4. Start the import and wait for confirmation. Verify that the tables appear.
  5. Connect the application to the correct database and test it.

Understand import limits

An SQL file may contain commands that drop or replace tables. Do not import into a live database without a current backup and an understanding of the effects. If the file exceeds the displayed size limit or the import times out, ask support about a larger import. Do not share an export through a public download link.

Sources and further reading