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.

Skipping a specific database in cPanel backups

Discussion in 'Database Discussions' started by rinogo, Jan 2, 2015.

  1. rinogo

    rinogo Member

    Joined:
    Dec 6, 2007
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    One of our accounts has a database that has grown to be so large (~50GB) that it is causing problems for the cPanel backup process. The problem is so severe that the cPanel backup process no longer completes successfully.

    We have other backup processes in place for this database, so having cPanel back it up is unnecessary. One solution to this problem could be to dissociate the database from the cPanel account:

    If we remove the database from the cPanel account, but leave the database intact (e.g. still active in MySQL), then:
    1. The web app would still be able to access the database, since the MySQL grants are still intact and valid.
    2. The cPanel backup process will effectively skip this large database, allowing the backup process to actually complete successfully.

    A consequence of this approach would be that we can no longer use cPanel to manage this database. This isn't a concern, as I'm comfortable working directly with MySQL through the shell.

    My questions are:
    1. Will this approach work like I'm expecting?
    2. Is there a better solution to our problem? (Needing to skip a specific database in cPanel backups)
    3. How do I remove the connection between cPanel and this specific database?

    Thank you!
     
  2. cPanelPeter

    cPanelPeter Technical Analyst III
    Staff Member

    Joined:
    Sep 23, 2013
    Messages:
    569
    Likes Received:
    15
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    You could disable the user from the backup and instead, create a cron job entry to call /usr/local/cpanel/scripts/pkgacct with the --skipacctdb option.

    This is explained here Package A cPanel Account.
    It would create a cpmove file instead with everything except the database.
     
  3. rinogo

    rinogo Member

    Joined:
    Dec 6, 2007
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Thanks, Peter! We ended up just dissociating the DBs from the cPanel account. To do so, we removed /var/cpanel/databases/<account>.cache and modified /var/cpanel/databases/<account>.yaml. Of course, now we must administer the DBs from the command-line, but that's fine. Are there any other drawbacks or concerns about this approach that we should be aware of?

    Next time around, we'll use the approach that you've provided. Thanks again!
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    You will not be able to manage the databases from cPanel and the databases will not count towards the account's disk space usage.

    Thank you.
     
Loading...

Share This Page