Exporting a database dump
Importing a database dump
Working with dumps from the command line
To create a backup, open the PHPMyAdmin interface.


The file with database contents will be downloaded to your computer. For large databases, we recommend using the command-line connection method.
We recommend creating a new database and importing the dump into it.
To restore a database, open the PHPMyAdmin interface and follow these steps:
.png)
After the database has been imported, update your site’s configuration files to replace the old database name with the new one, then verify functionality. For large databases, we again recommend using the command line.
Connecting to the hosting server via SSH allows you to manage databases remotely without downloading dumps to your computer. Databases larger than 1 GB uncompressed can only be handled via the command line.
To create a database dump, run the following command:
mysqldump -y -f -q --default-character-set=binary --create-options --single-transaction --skip-extended-insert --add-drop-table -h dbhost -u dbuser -pdbpassword dbname > dump.sql
where:
dbhost — database server address,
dbuser — MySQL username,
dbpassword — MySQL user password (written immediately after -p, without a space),
dbname — database name,
dump.sql — name of the dump file. Dump will be created in the current directory.
To import a database dump, run the following command:
mysql -h dbhost -u dbuser -pdbpassword dbname < dump.sql
We recommend creating a new database beforehand and importing the dump into it. The dump file must be uploaded to the hosting server (see the article FTP — Uploading Files to the Server).
After the database has been imported, update your website’s configuration files to use the new database name and verify functionality.