The Amazon S3 feature seems to upload website files but not database backups. I have recurring backups set up and working well for both files and the database, but only the file backups are uploaded to Amazon S3.

Comments

jpsalter’s picture

The database dumps are located in a directory named "backup_client" within your files directory. These are included in the tar file that is uploaded to Amazon S3. So, when you un-tar the backup you will also have a copy of your database.

mharrisonb’s picture

Ah ok, I understand now...I had changed the default folder for backups because the help file said the following:

"If you would like to save your files outside of your Drupal install you can use a path like this: ../backup_client. If this path is not web accessible then you'll enjoy more security with your backups."

I currently have it set to the folder ../../drupal_backup, so I'm guessing I could change that to just drupal_backup instead, and make sure that the permissions on the directory are 600 and it will be sufficiently secure. Is this correct?

Thanks for the quick response and the awesome plugin.

jpsalter’s picture

Yes, placing the backup_client folder within the Drupal root (for example - the public files directory) will cause the database dumps to be included in the tar file.

I'm sorry that it isn't more clear... I've been struggling to figure out a straight forward solution but there are a lot of different possible setups to support (and in Drupal 7 we need to deal with public *and* private folders). If you have any suggestions I would love to hear them.

mharrisonb’s picture

Thanks...now I'm a bit confused. On the Amazon S3 configuration page, it says:

"Each time Drupal cron is triggered - Backup Client S3 will check to see if a scheduled upload is needed. If so, the most recent backup will be uploaded to Amazon S3."

I thought that meant that when it's uploading to S3, it's not making a fresh backup but rather uploading the most recent tar.gz file (which could have been triggered by the "recurring backups" cron job at any point earlier) to S3.

I noticed that even though the drupal_backup directory I created is outside the web root, it still uploads the website backup files (the .tar.gz files) to S3. So why can't it upload the most recent sql.gz file as well?

In any case, it doesn't seem optimal to have the backup directory be within the web root because then the same backups are being uploaded to Amazon S3 again and again, which is somewhat of a waste of bandwidth.

If you can help me to better understand the issues, I'd be happy to help think of a solution. Thanks again.

jpsalter’s picture

I thought that meant that when it's uploading to S3, it's not making a fresh backup but rather uploading the most recent tar.gz file (which could have been triggered by the "recurring backups" cron job at any point earlier) to S3.

Yes - this is correct

I noticed that even though the drupal_backup directory I created is outside the web root, it still uploads the website backup files (the .tar.gz files) to S3. So why can't it upload the most recent sql.gz file as well?

The .tar.gz files are built out of everything within the Drupal root (after the database is dumped). I don't think I added code to handle the use case where the backup_client folder is outside the Drupal root

In any case, it doesn't seem optimal to have the backup directory be within the web root because then the same backups are being uploaded to Amazon S3 again and again, which is somewhat of a waste of bandwidth.

When the .tar.gz file is assembled - previous backup tar files are ignored. There is an option to only include the most recent .sql.gz file within the tar file too. But, this only works when the files are within the Drupal root.

The order of a backup is:

  1. Database dump file (.sql.gz)
  2. Create tar file (tar.gz)
mharrisonb’s picture

Status: Active » Closed (works as designed)

I'm rather late getting back to this, but I moved the backup folder to be within the web root (and set the appropriate permissions on it of course), and checked the option you recommended ("Include only the most recent database backup(s) in the website backup" under "Website backup options").

I think it will do what I want now. Thanks!