Skipping a specific database in cPanel backups

rinogo

Member
Dec 6, 2007
6
1
51
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!
 

cPanelPeter

Technical Analyst III
Staff member
Sep 23, 2013
574
17
143
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.
 

rinogo

Member
Dec 6, 2007
6
1
51
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!
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,229
463
Are there any other drawbacks or concerns about this approach that we should be aware of?
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.