Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Member
    Join Date
    Feb 2011
    Posts
    5

    Question MySQL backup

    Hi,

    I wanted to backup my MySQL databases and send them automatically to another server.

    I was told that it's not possible with the cPanel backup wizard.

    Assuming I only have FTP access on the other server, a cron task like that would work ? :
    (given by Ken at support but he wasn't sure)

    Code:
    0 1 * * * /usr/bin/ftp /var/lib/mysql user:password@IP:/pathtocopybackup
    Thanks for your help.

  2. #2
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,305
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: MySQL backup

    I'm a bit confused, why isn't the WHM > Backup > Configure Backup option "Backup SQL Databases (at least "Per Account" is needed to use the restore feature)" able to handle remote FTP backups precisely? You should be able to only back up your MySQL databases in that area and have them FTPed to a remote machine unless you want to have both backups (account and MySQL) but only send the MySQL ones to the remote FTP server.

    The command you've provided will not back up your MySQL databases properly. You should grab a dump file and then scp that dump to the remote machine:

    Code:
    mysqldump --all-databases > /home/alldatabases.sql
    Put the above into a bash script, then cron run the bash script. The bash script can include scping the file as well to the remote machine after it has been created.
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

  3. #3
    Member
    Join Date
    Feb 2011
    Posts
    5

    Default Re: MySQL backup

    Thanks for the reply.

    John Kata at support:

    While I understand you *only* wanted the MySQL directory to be backed up, this is currently not a possible configuration. Also note that the FTP option is only for account backups. It will not transfer the MySQL directory backup to a remote FTP server
    I don't have ssh access on the other server, only FTP. I didn't realy understood the dump file system but should a cron like that be better ?

    Code:
    0 1 * * * /usr/bin/ftp /backup/cpbackup/daily/dirs/_var_lib_mysql_.tar.gz user:password@IP:/pathtocopybackup

  4. #4
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,305
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: MySQL backup

    If you already have cPanel making a backup of the directory, you could certainly use that backup instead for the cron.
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

Similar Threads & Tags
Similar threads

  1. Where is the MySql backup
    By NDworman in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 04-01-2011, 11:38 AM
  2. Replies: 1
    Last Post: 01-18-2008, 09:44 AM
  3. How to disable mysql backup using cpanel backup
    By oumind in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 05-16-2007, 09:49 PM
  4. Backup mysql pb
    By paysite-cash in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 02-03-2005, 12:55 PM
  5. Backup and Mysql backup
    By adapter in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 05-06-2004, 12:31 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube