Articles in this section

How to back up / restore a system database in Plesk

Plesk for Windows Plesk for Linux ABT: Group A kb: auxiliary

Applicable to:

  • Plesk for Linux
  • Plesk for Windows

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 your 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.

 

Plesk for Linux
  • 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

Plesk for Windows Server

 

  • Creating a database dump

    C:\> plesk db dump <database_name> > C:\path\to\<dump_name>.sql

     

    Example
    The following command creates a database dump of the Plesk 'psa' database on C:\ drive:

    C:\> plesk db dump psa > C:\psa_dump.sql

     

     

  • Restoring a database from a database dump

    Use this command:

    C:\> plesk db < C:\path\to\<dump_name>.sql

     

    Example
    The following command restores the Plesk 'psa' database from the database dump psa_dump.sql located on C:\ drive:

    C:\> plesk db < C:\psa_dump.sql

    C:\> cd %plesk_dir%Mysql\Backup

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.