Backing up PostgreSQL and MySQL databases to Amazon S3
I'm wondering if anyone can help me with setting up WHM's backup function.
I've created a PostgreSQL database via shell (not cPanel) and also have MySQL databases that I DID create via cPanel. According to the text in WHM's Backup Configuration, it specifically mentions backing up MySQL databases but nothing about PostgreSQL. Additionally, if I DID NOT create my PostgreSQL database with cPanel's wizard, will I be able to configure WHM to back up this database?
I'm interested in backing these databases up to an Amazon S3 bucket instead of locally but cannot quite figure out how to do this or if it's possible to include my PostreSQL database that was manually built. The documentation doesn't get into this territory.
Any ideas? Thank you!
-
Have you tried forcing a backup (saved locally) and then check that backup for the PostgreSQL database? 0 -
Have you tried forcing a backup (saved locally) and then check that backup for the PostgreSQL database?
Yes, this does not save the backup of the installed PostgreSQL database. Also, unless I choose to 'Backup Accounts', I don't get any databases backed up that are associated with those accounts. The problem with INCLUDING the accounts is there are no flags to omit directories such as the 'public_html' dir. That dir is already backed up via GIT and I don't want to be pushing several GB to S3 on a daily basis for obvious reasons. We could run a Cron Job to backup the databases to a place where then C-Panel could have access to it, but we'd need to be able to know where that would be without having to save all of each accounts data. Can you offer any suggestions for this?0 -
The problem with INCLUDING the accounts is there are no flags to omit directories such as the 'public_html' dir. That dir is already backed up via GIT and I don't want to be pushing several GB to S3 on a daily basis for obvious reasons.
Hello, You can actually exclude entire directory via the use of an exclude file:0 -
Thank you, this is very helpful. I am used to having to always work within the constraint of WHM's GUI to get things done. One final question I have is with this part of the instructions: When adding directory names/file names into the cpbackup-exclude.conf file within the user directory, the instructions say: "Do not include leading or trailing characters of any kind, such as slashes (/) or periods (.)." So what of the symbolic links? For example, '.spamassassin'? How would I instruct cPanel to not backup these files? 0 -
Hello, You can still enter .spamassassin as an exclusion. The statement you are referring to is intended to clarify that you shouldn't use a period or slash to define a path (e.g. ./directory/here instead of directory/here). Thank you. 0 -
Any advice on setting up Amazon S3 so Cpanel doesn't over-write my daily backup? I'm currently only able to store one backup in S3, even though I've set up a rule there to retain each backup for 14 days before deleting. I'm assuming that Cpanel is issuing a delete command before uploading each daily backup. If this is the case, there needs to be a way for me to archive these without using Glacier storage (as that will not allow me a speedy recovery if God-forbid, I need to recover lost data). Thank you, Michael 0 -
Hello, Have you made any changes to the "Retention" value under "WHM >> Backup Configuration"? Thank you. 0 -
Yes, but I don't want the "Retention" to happen on the server that is hosting cPanel or we'll run out of space. Am I misunderstanding how it works? Obviously this is how it was working before I switched over to backing up to S3. Does the "Retention" only apply to S3 retention when S3 is used instead of local? 0 -
You won't have local backups retained if local backups are disabled. Thank you. 0 -
Ah, I see the tick box now. I had the "Retain backups in the default backup directory." checked. Un-checking that will only move backups to Amazon S3. This is fantastic. So happy cPanel added S3 backups! Thanks again! 0
Please sign in to leave a comment.
Comments
10 comments