S3 Purge Local Backup Feature + Fallbacks when local files are purged #60
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.
This pull request introduces a comprehensive enhancement to the S3 backup workflow, delivering significant disk space savings, improved multi-connection organization, and seamless operational continuity when local backup files are purged.
Part 1: S3 Purge Local Backup After Upload
s3_purge_localboolean setting, fully integrated across database, backend, and frontend..sqlbackup files are automatically deleted immediately after a successful upload to S3, freeing valuable server disk space.Part 2: Intelligent S3 Fallback for All Backup Operations
To ensure zero disruption when local files are purged, a robust fallback mechanism has been implemented across all backup operations:
DownloadBackup(),RestoreBackup(), andCompareBackups()now:s3_object_keyis stored:New Helper:
ensureBackupFileAvailable()inbackup_service.gocentralizes this logic for consistency and maintainability.Part 3: Automatic S3 Folder Organization by Database Connection
Backups are now automatically organized into subfolders based on the sanitized connection name, transforming flat S3 structures into a clean, scalable hierarchy:
Before:
After:
Backend Implementation:
UploadFileWithPath()method inS3Storageaccepts a subfolder.getObjectKeyWithPath()builds full S3 object keys using connection name.uploadToS3IfEnabled()now passes sanitized connection name as subfolder.Key Benefits:
s3_object_keywith full path.Frontend Enhancements (TypeScript/React)
s3_object_key?: stringadded toBackupinterface inbackup.ts.Key Features & Guarantees
Result for Users
Administrators can now: