Move backups to block storage instead of copy#3060
Merged
Conversation
9 tasks
StevenMaude
approved these changes
May 13, 2026
Contributor
StevenMaude
left a comment
There was a problem hiding this comment.
summary: I have one question about maybe making the backup more robust. Otherwise, the changes look fine.
| cp --preserve=mode,timestamps "$BACKUP_FILEPATH.zst" "$BLOCK_BACKUP_DIR" | ||
| cp --preserve=mode,timestamps "$SANITISED_BACKUP_FILEPATH.zst" "$BLOCK_BACKUP_DIR" | ||
| mv "$BACKUP_FILEPATH.zst" "$BLOCK_BACKUP_DIR" | ||
| mv "$SANITISED_BACKUP_FILEPATH.zst" "$BLOCK_BACKUP_DIR" |
Contributor
There was a problem hiding this comment.
question: Since I think this involves a different filesystem, the mv is presumably a full copy operation, if I'm right?
If so, is it worthwhile to verify, either using rsync or hashing the files before and after, that the files have correctly copied, as a guard against faulty hardware?
Contributor
Author
There was a problem hiding this comment.
Good point rsync -av --remove-source-files ?
Database backups use significant space on the main volume of dokku3. To save space on the main drive, and to improve our storage capacity, we want to move the backups storage to DigitalOcean Block Storage. Now that we have seen the backups successfully copy across in production, we can remove the source files don't need to exist in both places. This will free up space. `rsync` takes checksums after the transfer before deleting the local copy and will return non-zero in the event of failure, notifying us via Sentry. I think it makes sense that the backup generation, sanitisation, and compression will continue to be done locally as the local file system access is likely faster than doing everything directly in block storage. Cleaning up the existing backup folder can be done manually to free the space once we see that this has worked.
a3547f0 to
5992212
Compare
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.
Part fixes #2910.
Database backups use significant space on the main volume of dokku3. To save space on the main drive, and to improve our storage capacity, we want to move the backups storage to DigitalOcean Block Storage.
Now that we have seen the backups successfully copy across, we can change the
cpcommand to amv, as the backups don't need to exist in both places. This will free up space.I think it makes sense that the backup generation, sanitisation, and compression will continue to be done locally as the local file system access is likely faster than doing everything directly in block storage.
Cleaning up the existing backup folder can be done manually to free the space once we see that this has worked.
Tested locally with:
Then checking expected files and symlinks were in place in the "block storage" location and not in the "database storage" location.