Feature/digital 721 backup restore s3#462
Open
jacobaaronyeager wants to merge 8 commits into
Open
Conversation
…erraform, strip cms/public prefix so files land in local Drupal layout, and surface aws errors. Add trap-based temp service-key cleanup to prevent leaked keys from exhausting the bucket key quota.
…to the local Lando site, handling the MySQL→MariaDB collation rewrite, container-relative import path, and a targeted s3fs uninstall. Delete the downloaded archive after -x extraction in download_files_common.sh and document the local refresh tooling in the README and backend docs.
… so they don't get downloaded every time, and added flags to force them
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Jira ticket
DIGITAL-721
Purpose
This adds:
Deployment and testing
Local Setup
You'll need to be logged into Cloud.gov and targeting the space you want to pull from:
No rebuild needed. If you want to try the local refresh, a working Lando site is enough.
QA/Testing instructions
New scripts in
/scriptspull backups from whatever space you have targeted (project and space are derived automatically):./scripts/download_files.sh— downloads the public files. Add-xto extract them intoweb/sites/default/files(thecms/public/prefix is stripped so they land where Drupal expects). Without-xyou just get the.tar.gz../scripts/download_static.sh— same, for the generated static site../scripts/refresh-local.sh— the one-step version: imports the DB, loads the files, uninstalls s3fs locally so images serve from disk, rebuilds cache, and hands you a login link. Use--no-db/--no-filesto run just one part,-d YYYY-MM-DDfor an older backup.To confirm: run
./scripts/refresh-local.sh, open the login link, and check that a page with uploaded images renders (images come fromsites/default/files, including thestyles/derivatives).Backup side: the "Daily backup" action now backs up the storage and static buckets alongside the database, and there's a "Files Restore" workflow to push them back. These run against prod on the scheduled job.
Note: loading a prod DB onto a feature branch can leave config/DB drift (e.g. a module the branch expects isn't enabled, or a
cimconflict on a changed field). That's expected — runlando drush cimyourself if you want your branch's config fully applied. The refresh script deliberately doesn't do that for you.Checklist for the Developer
Checklist for the Peer Reviewers