Question
How to create a dump of a system database in Plesk?
How to restore a system database from a database dump?
Answer
To back up/restore a database, connect to a Plesk server via SSH (Linux) / RDP (Windows Server) and follow the instructions below:
Note: To restore Plesk system databases from a Plesk daily / pre-upgrade dump, visit this KB article.
-
Creating a database dump
# plesk db dump <database_name> > /path/to/<dump_name>.sql
Example
The following command creates a database dump of the Plesk 'psa' database in the/root
directory with today's timestamp:# plesk db dump psa > /root/psa_dump.sql
The following database dump will be created:
# ls /root/psa_dump.sql
psa_dump.sql -
Restoring a database from a database dump
# plesk db < /path/to/<dump_name>.sql
Example
The following command restores the Plesk psa database from the database dump 'psa_dump.sql' located in the/root
directory:# plesk db < /root/psa_dump.sql
-
Creating a database dump
C:> plesk db dump <database_name> > C:pathto<dump_name>.sql
Example
The following command creates a database dump of the Plesk 'psa' database onC:
drive:C:> plesk db dump psa > C:psa_dump.sql
-
Restoring a database from a database dump
Use this command:
C:> plesk db < C:pathto<dump_name>.sql
Example
The following command restores the Plesk 'psa' database from the database dumppsa_dump.sql
located onC:
drive:C:> plesk db < C:psa_dump.sql
C:> cd %plesk_dir%MysqlBackup