How to backup or restore a Plesk database?




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

  • 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

Please sign in to leave a comment.

Have more questions? Submit a request