The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Disable MySQL database

Discussion in 'General Discussion' started by optidel, Mar 27, 2012.

  1. optidel

    optidel Registered

    Joined:
    Mar 27, 2012
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi,

    My databases are pretty big - 25 GB or so in size and the mysqldump used by cPanel backup is a huge bottleneck. We would like to move to Xtrabackup software. Hence we would like to disable only the mysql database backing up. We would like cPanel to back up the rest of the stuff.

    I hear that it is likely to be an option in 11.34 of cPanel but we cannot wait till then. Any idea how to disable it in 11.32.2 (build 8)? If it means making changes to the cpbackup script file, we will not mind doing it.

    Thanks In Advance
     
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    That's a very good question and I don't see any such option in WHM > Backup > Configure Backup area, since only these selections appear there:

    Code:
    Backup SQL Databases
    (at least "Per Account" is needed to use the restore feature) 
    
    Per Account Only
    Entire MySQL Directory
    Per Account and Entire MySQL Directory
    I tried using the cpbackup-exclude.conf file in /var/lib with "mysql/*" added into that file, but the MySQL files were still backed up.

    The only option I could see would be to not use the cPanel backup and instead run this command via a script (that you could run using a cron):

    Code:
    for i in `cat /etc/trueuserdomains | cut -d: -d' ' -f2-` ; do /usr/local/cpanel/scripts/pkgacct --skipacctdb $i /backup/pkgacct ;done
    The command obtains a list of usernames from /etc/trueuserdomains, and then it runs pkgacct script by skipping the databases (see pkgacct | Package a cPanel account for the --skipacctdb flag), and then places a copy of those backups into /backup/pkgacct location. If /backup/pkgacct doesn't already exist, simply create it first:

    Code:
    mkdir -p /backup/pkgacct
    Of course, you can always put the destination for storing the files elsewhere on the machine.

    Now, you will still end up with cpmove-username/mysql and mysql-timestamps folders when using the skipacctdb flag, but those folders will be empty.
     
  3. optidel

    optidel Registered

    Joined:
    Mar 27, 2012
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Fantastic. This works perfectly and was exactly what I was looking for.
     
Loading...

Share This Page