Skip to content

Instantly share code, notes, and snippets.

@jeffbeagley
Last active June 26, 2020 17:18
Show Gist options
  • Save jeffbeagley/c01af0f682db9b7cf8c180b1e2e6e32c to your computer and use it in GitHub Desktop.
Save jeffbeagley/c01af0f682db9b7cf8c180b1e2e6e32c to your computer and use it in GitHub Desktop.
// How to create a SQL backup using Drush for D7 and write to file that can later be sent to S3
drush sql-dump | gzip | aws s3 cp - s3://<bucket>/backups/database/dev-full.sql.gz
// Import from S3 directly
aws s3 cp s3://<bucket>/backups/database/dev-full.sql.gz - | gunzip -c | drush sqlc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment