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.
- In cPanel, open phpMyAdmin.
- Select the database you want to export from the left-hand list.
- Click the Export tab at the top.
- Leave the export method on Quick and the format on SQL.
- 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)
- Create the destination database first, if it doesn’t exist, in MySQL Databases.
- In phpMyAdmin, select that database.
- Click the Import tab.
- Choose your
.sqlfile (compressed files like.sql.gzwork directly). - 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.