Ultra Web Hosting Docs

Importing & Exporting Databases

Exporting saves a copy of your database as a SQL file you can keep as a backup or move to another server. Importing loads that file back in. Both are easy in phpMyAdmin, with a couple of extra options for large databases.

Exporting with phpMyAdmin

  1. Open phpMyAdmin from cPanel.
  2. In the left pane, click the database you want to export.
  3. Click the Export tab at the top.
  4. Choose an export method (see below), leave the format set to SQL, and click Go.
  5. Your browser downloads a .sql file containing the complete database.

Quick vs Custom

Tip Export a copy of your database before any risky change — a plugin update, a theme switch, or a bulk edit. A SQL export is small, fast, and gives you a clean point to restore from.

Importing with phpMyAdmin

  1. Open phpMyAdmin and select the target database in the left pane.
  2. Click the Import tab.
  3. Click Choose File and select your .sql or .sql.gz file.
  4. Leave the format as SQL and click Go.
  5. phpMyAdmin loads the file and reports success when it finishes.
Warning Importing a SQL file overwrites any existing tables of the same name and replaces their data. If you are importing into a database that already has content, export a fresh backup of it first so you can roll back if something goes wrong.
Note Browser uploads through phpMyAdmin have a practical size limit of around 50 MB. A gzipped export often stays under this. If your file is larger, use one of the methods for large databases below.

Handling Large Databases

When a database is too big to import through the browser, you have a few options:

Importing over SSH

If you have SSH access, upload the .sql file to your account, then run the mysql client. The -p flag prompts for the database user's password:

mysql -p cpuser_dbname < backup.sql

Replace cpuser_dbname with your full prefixed database name and backup.sql with your file. If the file is gzipped, decompress it on the fly:

gunzip < backup.sql.gz | mysql -p cpuser_dbname

Downloading a Database from cPanel Backup

You do not have to open phpMyAdmin just to grab a copy of a database. The cPanel Backup tool offers a one-click download:

  1. Log into cPanel.
  2. In the Files section, click Backup.
  3. Under Download a MySQL Database Backup, click the name of the database.
  4. A .sql.gz file downloads to your computer.

You can restore this same file from the Backup page later — see Backups & Restore for the full process.