We have been using the s3-php-curl library for some time successfully. It's a great utility that allows you to save, manage, and schedule backups to Amazon's S3 service through the Drupal user interface.
However, we noticed that the library causes Backup and Migrate to go whitescreen on our Ubuntu 14 server installations running PHP 5.5.9. In particular, you can't access Backup and Migrate's restore tab without getting a blank screen.
We discovered this issue migrating from older development instances in Ubuntu 12 to newer production instances in Ubuntu 14, and we don't experience this bug on the older Ubuntu 12 instances.
The downloads of the S3-php5-curl library available on the Undesigned blog page (http://undesigned.org.za/2007/10/22/amazon-s3-php-class/) are out of date, and it doesn't look like the library is being maintained. The backup_migrate module should probably use a different solution going forward.
Our solution has been simple: we delete the S3-php5-curl library, and the restore page reappears, albeit with errors. In older versions of backup and migrate we can delete the S3 destinations and make the errors go away. However, there is no affordance in newer versions of the backup_migrate to delete backup destinations (perhaps that's an oversight?).
We have cobbled together a cron task using a command line utility for S3 (s3cmd) and a very basic shell script to achieve the same functionality:
First install s3cmd
sudo apt-get install s3cmd
Next, create a scripts folder (if you don't have one already) and create a shell script:
mkdir ~/scripts
nano ~/scripts/s3-sync.sh
Add a modified version of the following into your editor:
#! /bin/bash
# sync F1 all backups directories with S3 bucket
s3cmd sync /[path to drupal root]/sites/default/private/backup_migrate/ s3://[your-bucket-name]/[folder]/
# now append a record to the log file
#
echo "$(date -R) | sync F1 backups directories with S3 bucket" >> /[path to log folder]/sync.log
echo "finished syncing backups directories to S3"
#
Next, add a cron task
crontab -e
and add a modified version of this example to your cron file to run the script 4 times a day at 05:57, 11:57, 17:57 and 23:57:
# m h dom mon dow command
57 05,11,17,23 * * * /home/[username]/scripts/s3-sync.sh
I'm hoping other folks will feel free to improve on this very basic approach.
Comment | File | Size | Author |
---|---|---|---|
#16 | backup_migrate-n2382541-16.patch | 973 bytes | DamienMcKenna |
| |||
#12 | readme_update-2382541-12.patch | 1.04 KB | sano |
Comments
Comment #1
sammy-node CreditAttribution: sammy-node commentedModulist - thanks for the short-term fix above
Separately I'd be keen to see someone address the issue raised above and would be happy to contribute a fee for it to be sorted out.
Comment #2
dman CreditAttribution: dman commentedAWS for backup_migrate works OK on PHP 5.3.18 and 5.4.8 (according to Acquia dev desktop) But I was able to replicate the WSOD on PHP 5.5.9-1ubuntu4.5
The error (in /var/log/apache2/error.log) was
So ... it looks like this fresh Ubuntu box needs to have cURL turned on.
With a restart,
* The WSOD was gone, and
* Backups were being saved correctly to S3.
So mainly - it looks like the module just needs to check that cURL extension is available before calling the s3 php library.
And so do the users that install it...
However, there looks to be a small issue with PHP 5.5 still.
When trying to *list* the backup files, I got
But I was able to confirm (through the AWS console) the the files were up there, so that's the important bit for now.
Comment #3
dman CreditAttribution: dman commentedFollowing up, I traced the reason files were not being listed - it seems a bit odd inside the REST request, so after looking for a while, I decided to upgrade the s3-php library
The original (2009) from http://undesigned.org.za/2007/10/22/amazon-s3-php-class/
is now being supported on github (as you can tell by the info on the project page)
The download you can fetch from https://github.com/tpyo/amazon-s3-php-class
You can clone it with
or download from https://github.com/tpyo/amazon-s3-php-class/archive/master.zip and rename to s3-php5-curl
Surprisingly, the API seems to have been kept stable, and it just drops right in!
Comment #4
sammy-node CreditAttribution: sammy-node commentedOK nice one - thanks Dan - using the Github repo version of the library worked perfectly
Comment #5
modulist CreditAttribution: modulist commentedThanks dman for your posts... they resolved the issue. Perhaps it could get included in the installation instructions for the module!
Comment #6
couturier CreditAttribution: couturier as a volunteer commentedIs this still an issue with 7.x-3.2?
Comment #7
couturier CreditAttribution: couturier as a volunteer commentedClosing after more than two weeks with no activity.
Comment #8
sano CreditAttribution: sano commentedgood work @dman. thanks.
Comment #9
couturier CreditAttribution: couturier as a volunteer commentedThis should be put in current documentation if it is still an issue.
Comment #10
sano CreditAttribution: sano commentedI think it should be sufficient to modify the Readme file. Currently it states:
OPTIONAL:
* Enable token.module to allow token replacement in backup file names.
* To Backup to Amazon S3:
- Download the S3 library from
http://undesigned.org.za/2007/10/22/amazon-s3-php-class
and place the file 'S3.php' in the includes directory in this module.
The stable version (0.4.0 – 20th Jul 2009) works best with Backup and
Migrate.
...should probably read:
OPTIONAL:
* Enable token.module to allow token replacement in backup file names.
* To Backup to Amazon S3:
- download the most recent version from https://github.com/tpyo/amazon-s3-php-class
- You can clone it with command:
git clone https://github.com/tpyo/amazon-s3-php-class.git s3-php5-curl
-... or download from https://github.com/tpyo/amazon-s3-php-class/archive/master.zip
- rename the unzipped folder to s3-php5-curl
The most recent version of the library known to work is 0.5.1, with the Backup & Migrate module version 7.x-3.5+8-dev
Comment #11
couturier CreditAttribution: couturier as a volunteer commented@sano Thanks! I believe that we update documentation through patches, correct? Otherwise we would have to assign this to a maintainer who can go in and manually change the text file. @sano Can you write a patch for README.txt?
Comment #12
sano CreditAttribution: sano as a volunteer commentedHere is the patch. Hopefully I made no mistakes creating/naming it.
Comment #13
couturier CreditAttribution: couturier as a volunteer commentedThank you! Hopefully we can get this reviewed in time to add to the next release. We appreciate your help. The maintainers for this module do work in spurts, so you should see a round of activity just before the next release.
Comment #14
couturier CreditAttribution: couturier as a volunteer commentedComment #16
DamienMcKennaRerolled and tidied up a little bit.
Comment #18
DamienMcKennaCommitted. Thanks all.
Comment #19
DamienMcKenna