cPanel & WHM Version 98 has been released, and brings a slew of great updates. Take a look at what is included, and then upgrade today!

pkgacct: add feature to skip database data, but not database existence

Phillip Baker shared this idea 6 years ago
Open Discussion

We have an existing, 3rd party backup solution that backs up the entire server and takes consistent mysql backups each time a system snapshot is taken. We run these backups 6 times a day.

In order to protect against customers accidentally deleting (or in the event that they wish to undelete) a cpanel account, we also use a script that fires every night to backup all cpanel account metadata by calling pkgacct for every account with "--skiphomedir" set. If a customer deletes a cpanel account, we restore the metadata using the cpmove file, and then seperately restore their files and database from our 3rd party backups.

The reality is, however, that we are creating cpmove files containing mysql data when it simply isn't necessary - this means more I/O and larger backups - using the existing --skipacctdb completely ignores the existence of mysql databases and users altogether, which isn't really much of a solution either.

I would like to request the addition of a variation on --skipacctdb (perhaps --skipacctdbdata) that still takes account of the existence of databases, and the credentials configured to access them, but does not actually dump the contents of the databases at the time of backup, and when restored simply creates empty databases. This shouldn't be too complicated to add; it's essentially like the regular backup - just without a mysqldump.

Replies (3)


Are you looking to have it backup the schema and not the data, or just an empty file for the database?


To be honest, either would be fine (as schemas are not going to require a lot of I/O or diskspace!), but I was thinking a completely empty, schemaless DB when I wrote this!


This would be a real time saver, would love to see the option implemented.

Leave a Comment
Attach a file