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.

customized backups

Discussion in 'Data Protection' started by Abdelmks, Mar 13, 2017.

Tags:
  1. Abdelmks

    Abdelmks Active Member

    Joined:
    Aug 4, 2016
    Messages:
    30
    Likes Received:
    2
    Trophy Points:
    8
    Location:
    Morocco
    cPanel Access Level:
    Root Administrator
    Hello,
    I want to configure a customized backup,
    to explain well, I want to make backup of databases on my server separately once a week, and i want to make backups on my projects folder one time on two months.
    So I want to know how can I configure this ?
    Thank you
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    36,995
    Likes Received:
    1,275
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    You can configure backups via "WHM Home »Backup » Backup Configuration". This option is documented at:

    Backup Configuration - Documentation - cPanel Documentation

    If you only want to backup your databases, browse to "WHM >> Backup User Selection", unselect all users, and then browse to "WHM >> Backup Configuration" and choose "Entire MySQL Directory" when enabling backups.

    Regarding the individual projects folder, you can backup the entire account this directory exists under, and then choose to exclude certain aspects of the account using an exclude file:

    How to Exclude Files From Backups - cPanel Knowledge Base - cPanel Documentation

    Thank you.
     
    SysSachin likes this.
  3. Abdelmks

    Abdelmks Active Member

    Joined:
    Aug 4, 2016
    Messages:
    30
    Likes Received:
    2
    Trophy Points:
    8
    Location:
    Morocco
    cPanel Access Level:
    Root Administrator
    Thank you Mr Michael for your answer,
    for the first issue, it's ok
    but for configuring backups for other folders of my projects, I don't understand your suggestion, and I will explain my question again,
    In addition to backup databases once a week, I want to make backups of users one time on two months.
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    36,995
    Likes Received:
    1,275
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    You can choose "Backup Monthly" under "Scheduling and Retention" in "WHM >> Backup Configuration" to enable monthly backups. However, it's not possible to use separate retention periods for MySQL and the accounts. You'd have to manually setup a custom cron job that copies the databases to a directory on the server via the "mysqldump" utility:

    MySQL :: MySQL 5.6 Reference Manual :: 4.5.4 mysqldump — A Database Backup Program

    Thank you.
     
  5. Abdelmks

    Abdelmks Active Member

    Joined:
    Aug 4, 2016
    Messages:
    30
    Likes Received:
    2
    Trophy Points:
    8
    Location:
    Morocco
    cPanel Access Level:
    Root Administrator
    but I think that's not possible to make weekly backup for one user and monthely for others ?
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    36,995
    Likes Received:
    1,275
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    That's correct. There's an open feature request for that functionality at:

    Per account backup policy

    Feel free to vote for the request if you'd like to see it added in the future.

    Thank you.
     
  7. Abdelmks

    Abdelmks Active Member

    Joined:
    Aug 4, 2016
    Messages:
    30
    Likes Received:
    2
    Trophy Points:
    8
    Location:
    Morocco
    cPanel Access Level:
    Root Administrator
    Hello mr @cPanelMichael
    I have tested backups of databases only, but I don't know where I can to find those backups ..
    My default backup directory is /home/backup
    Thank you
     
  8. Abdelmks

    Abdelmks Active Member

    Joined:
    Aug 4, 2016
    Messages:
    30
    Likes Received:
    2
    Trophy Points:
    8
    Location:
    Morocco
    cPanel Access Level:
    Root Administrator
    I find it, it's located at : /home/backup/[date_of_your_backup]/system/dirs/_var_lib_mysql_.tar.gz
    the questions now are.. how to use those backups after ? can I have backups separately, one file .sql for each user ?
    Thank you

    Please @cPanelMichael can you help me ??
     
    #8 Abdelmks, Mar 20, 2017
    Last edited by a moderator: Mar 21, 2017
  9. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    36,995
    Likes Received:
    1,275
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    This is a backup of the entire /var/lib/mysql directory. You'd extract the database's directory from this backup file, and then copy the contents over to the /var/lib/mysql/database_name directory on the server if you needed to restore the contents of a database. If the database was completely removed, you'd need to first create the database for the account via cPanel.

    Thank you.
     
Loading...

Share This Page