How to back up/restore Plesk system databases




  • Avatar
    Alex Rubio Cazador

    I have a issue when i try to do this command included in a crontab

    plesk db dump DATABASE_NAME > C:\FULL\PATH\TO\FILE_NAME.sql

    when I execute manually the command runs perfect and i can backup all my sql files, but when i use this comend inside a crontab, they create and retund the .sql files empty

    Thank you.

    Comment actions Permalink
  • Avatar
    Denis Bykov

    @Alex Rubio Cazador
    Try using the full path to the executable instead of the alias:

    For Linux:

    # MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysqldump -u admin DATABASE_NAME > /full/path/to/BACKUP_FILE_NAME.sql

    For Windows Server:

    C:\>"%plesk_dir%\Mysql\bin\mysqldump.exe" -uadmin -p<plesk_admin_password> -P8306 DATABASE_NAME > C:\FULL\PATH\TO\FILE_NAME.sql

    Comment actions Permalink
  • Avatar

    hai am new to plesk am getting error while am updating plesk

    Internal error: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'psa.ServiceInstallations' doesn't exist

    how to rectify this error

    Comment actions Permalink
  • Avatar
    Ivan Postnikov

    Hello @santhosh,

    This behavior may be caused by several issues:

    • Server is running out of RAM.
    • Some limits are exceeded on a container or on a hardware node.
    1. Connect to the server via SSH;
    2. Make sure that it is enough memory or container resources:

      # free -m
      # cat /proc/user_beancounters

      There should be enough memory and all 'failcnt' values should be 0. 

      Do the following in order to fix the issue:

      1. If you are leasing a virtual container, please contact your service provider in order to increase container limits.
      2. Increase amount of RAM or SWAP on the server.
    3. After fixing the limits issue, re-run the upgrade How to upgrade Plesk to the next release

    Check this article for reference:

    Comment actions Permalink
  • Avatar
    Kingsley Felix

    Can i use this to restore a domain that was deleted?

    Comment actions Permalink
  • Avatar
    Alexey Lapshin

    Hello @iamkingsleyf,

    For restoring whole domain (subscription) it is required to use the backup, created by backup manager.
    Navigate Tools & Settings > Backup Manager > select required backup and choose the subscription you need to restore.

    Use the following articles as reference:


    Comment actions Permalink
  • Avatar
    Sergio Sanchez (Edited )

    Please note that ...
    plesk db dump <database_name> > /path/to/<dump_name>.sql
    ... and the respective ...
    MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysqldump -uadmin <database_name> > /path/to/<dump_name>.sql
    .. as well as the backups generated in the backup manager (I assume the same tools are used) will not backup created events.

    To include events use
    MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysqldump -uadmin <database_name> --events > /path/to/<dump_name>.sql

    Would be nice to see this added to the the backup manager as I was quite astonished to see that my database backups do not contain events.

    Comment actions Permalink
  • Avatar
    George Alibegashvili

    Hello @Sergio Sanchez,

    Thank you for your suggestion.

    I've created User voice request for this feature
    Please vote for this suggestion and feel free to discuss it there, the top-ranked suggestions are likely to be included in the next versions of Plesk.

    Comment actions Permalink

Please sign in to leave a comment.

Have more questions? Submit a request