Whether you’re backing up a site, moving it to a new server or restoring after a problem, you’ll need to import and export databases. It sounds technical, but with phpMyAdmin it’s a straightforward, safe process. Here’s how to do both properly.

Exporting a database (making a backup)

Exporting produces a single .sql file containing your entire database — every table and every row.

  1. In cPanel, open phpMyAdmin.
  2. Select the database you want to export from the left-hand list.
  3. Click the Export tab at the top.
  4. Leave the export method on Quick and the format on SQL.
  5. Click Export to download the file.

Keep that .sql file safe — it’s a complete snapshot you can restore from. Take one before any risky change.

Exporting a large database

For a big database, the Custom export method lets you compress the output (gzip), which produces a much smaller file that’s quicker to download and less likely to hit size limits when you re-import it. Choose gzip compression for anything large.

Importing a database (restoring or migrating)

  1. Create the destination database first, if it doesn’t exist, in MySQL Databases.
  2. In phpMyAdmin, select that database.
  3. Click the Import tab.
  4. Choose your .sql file (compressed files like .sql.gz work directly).
  5. Click Go.

phpMyAdmin rebuilds every table from the file.

Import into an empty database

For a clean import, the target database should be empty. If it already has tables (say you’re re-importing over an old copy), either drop the existing tables first or import into a fresh database — otherwise you can get “table already exists” errors. Importing into a clean database avoids conflicts.

Handling large imports

Very large database files can exceed phpMyAdmin’s upload limit or time out mid-import. If that happens, compress the file (gzip), raise your PHP upload and execution limits in the INI Editor, or — for genuinely huge databases — let us import it from the command line, which has no such limits. Just send us the file.

After importing during a migration

If you imported a database as part of moving a site, remember to update the application’s config with the new database name, user and password. For WordPress, that’s wp-config.php. And if the domain changed, run a search-and-replace on the imported data to update the old URLs.

These two operations are the backbone of backups and migrations. If a database is too large to move through the browser, we’re happy to handle it server-side for you.

Was this article helpful to you?

admin

Leave a Reply

You must be logged in to post a comment.