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.

pkgacct --skipacctdb but not .create and users (mysq.sql) ?

Discussion in 'Data Protection' started by chrismfz, Aug 4, 2014.

  1. chrismfz

    chrismfz Well-Known Member

    Joined:
    Jul 4, 2007
    Messages:
    109
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Greece
    cPanel Access Level:
    DataCenter Provider
    Is there a way to skip database backup (--skipacctdb)
    but not the database structure (~/mysql/database.create) and the user permissions which is stored in ~/mysql.sql file ?
    (GRANT USAGE ON *.* TO .....)

    So on a restore of such a backup I will have the name of the databases restored (empty DBs) and any users connected to them but just not mysql data.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,736
    Likes Received:
    661
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    There are no native features that will only backup the database structure and not the database content. Feel free to open a feature request for this via:

    Submit A Feature Request

    In the meantime, you could skip the databases completely and back them up separately using mysqldump.

    Thank you.
     
  3. chrismfz

    chrismfz Well-Known Member

    Joined:
    Jul 4, 2007
    Messages:
    109
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Greece
    cPanel Access Level:
    DataCenter Provider
    Hello Michael. I know that (skip completely).

    Scenario:
    Let's say I use R1Soft for example. R1Soft can't restore accounts if I (or the clients program let's say whmcs) accidentally terminate an account.

    So R1Soft suggests using a script (resides here Backup and Restore individual cPanel accounts - Knowledge Base - Server Backup Manager: Docs, KB Articles, Technical Papers ) and take "empty" cpmove-xxx.tar.gz backups for this reason.

    But there are users with multiple and large DBs, and it takes a while (hour+) -plus- it consumes more space. So I tried with skipacctdb.
    It completely removes the DB name, the users associated with the DBs and the content/data of the DBs.

    So this ^ I was wondering if there is a way to backup MySQl users, the database.create file for creating the db and just not the mysqldump.

    (Generally, anything else except the dump if you prefer saying this way), So a restore using R1Soft could be easier and less time consuming (assuming I already got in the cpmove the DB names and the MySQL users associated with them).
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,736
    Likes Received:
    661
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    There are no native options with cPanel to backup databases in that manner. That being said, you may find the following directory useful:

    /var/cpanel/databases/

    It includes the YAML files for users indicating which databases are assigned to the account, and which database users are assigned to those databases. Assuming you have the entire MySQL directory backed up with R1Soft, this might be the data you are looking for.

    Thank you.
     
Loading...

Share This Page