Repository navigation
Backup: replace rclone with restic, close backup gaps - #37
Merged
Merged
Conversation
…QLite snapshots One encrypted restic snapshot per run: stack files, named Docker volumes, consistent dumps of running Postgres/MySQL/MongoDB containers, external databases and online SQLite copies. Restore recreates databases from their dumps, restores volume data and starts the stack again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
setup-backup.sh now configures restic with Cloudflare R2 (default), Backblaze B2, any S3 endpoint, SFTP or a local directory, generates the repository password, writes a private config and schedules the daily run that also covers databases. restore.sh lists snapshots and restores all apps or one. The rclone scripts, the separate database backup setup and the unused Mikrus attic script are removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ket fails or is created at once restic cat config retries a missing S3 bucket for many minutes. restic init creates the bucket, or fails immediately on bad keys; an existing repository is then opened to check the password. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…en the repository The wizard writes backup.env.new and moves it over backup.env only after init succeeds, so a mistyped password no longer replaces a working setup. The heartbeat URL must be an http(s) address. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Database dumps and SQLite copies are in the snapshot; keeping them in /opt/backups/stackpilot until the next night doubled the database size on disk. They stay when restic backup fails. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Images that declare VOLUME (mongo: /data/configdb) get a random volume name that does not exist after the stack is recreated, which aborted the restore. Such volumes are recorded as @service:/path and found in the new container. A volume that cannot be found is reported and the restore exits non-zero. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
deploy.sh --db-source=bundled reported a bundled MySQL but the compose file had no db service, so WordPress could not reach db:3306. MySQL 8.0 used 427 MiB in a test install, so the limit is 512M. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Servers set up with the old backup kept /etc/cron.d/stackpilot-db-backup (nightly local dumps) and a root crontab entry for backup-core.sh, which now points at the restic engine and would fail nightly. Found on a real test VPS. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
Backups move entirely to restic: encrypted, versioned, deduplicated snapshots with 14 daily / 8 weekly / 12 monthly retention. No backward compatibility: rclone,
rclone cryptand Google Drive/Dropbox/OneDrive OAuth are removed.local/setup-backup.sh: Cloudflare R2 (default), Backblaze B2, any S3 endpoint, SFTP, local directory. Generates the repository password (shown once) or reuses an existing one on a new server; the working config is replaced only after the repository opens.system/backup-core.sh(installed as/usr/local/sbin/stackpilot-backup): app files, named and anonymous Docker volumes, database dumps detected by image (Postgrespg_dumpall, MySQL/MariaDB, MongoDB), consistent SQLite snapshots, external databases,/etc/caddy,/var/www; heartbeat ping on success/failure; weeklyrestic check; restic 0.19.1 pinned by SHA256.local/restore.sh: pick a snapshot, restore everything or one app, explicit confirmation.stackpilot-db-backupcron, crontab entry) during setup.--db-source=bundledhad no database service.Test plan
./tests/run.sh: 406 passed, 0 failed🤖 Generated with Claude Code