Backups & Recovery Guide
Simply Social Planner: where your backups live, how to restore them, and how to recover the app if a deployment breaks.
A database backup restores your records and uploaded attachments. GitHub restores the app’s code. Your independent password manager holds the configuration secrets needed to reconnect the two.
1. What is protected
| Piece | Recovery source | What to do |
|---|---|---|
| Projects, tasks, ideas, notes, settings and all other database tables | Private Cloudflare R2 bucket planner-backups | Use Restore. |
| Files uploaded to Convex storage | Included in the same ZIP | Restore imports the stored files and preserves their IDs. |
| Frontend, backend functions, schema and scheduled-job definitions | Private GitHub repository, commits and release tags | Redeploy the matching code. |
| Environment variables and encryption key | Your password manager | Re-enter into the provider dashboards. |
| Logins, domain settings and the Google OAuth application | Clerk, Cloudflare and Google accounts | Recover the accounts or recreate the provider configuration. |
Not included: browser-only preferences or unsynced local-mode data, linked webpages, the full contents of Google Drive or Google Calendar, provider account settings, and pending scheduled-function executions. A cached Google event is not a backup of your entire Google account.
2. Schedule & retention
- GitHub Actions starts the job at approximately 8 pm Pacific. It runs on GitHub’s servers whether your PC is on or off. The schedule follows daylight saving time. GitHub can delay scheduled starts.
- Convex makes a consistent snapshot of the live database with uploaded file storage included. The app remains usable; the export consumes database/file bandwidth and could take longer as data grows.
- The job checks the archive and uploads it to R2. New uploads are downloaded again and compared using SHA-256 before success is reported.
- The planner records the result. Failures notify you by the configured email and Telegram channels. Normal successful backups are silent.
| Folder in R2 | Purpose | Retention |
|---|---|---|
daily/ | Every successful backup | Daily files expire after 14 days; locked against deletion for those 14 days. |
monthly/ | First successful backup each month | Files expire after 95 days; locked for 90 days. Roughly three months of protection. |
pre-restore/ | Safety copy immediately before replacing data | Expires after 30 days; locked for 7 days. |
Retention is age-based, not an exact file-count limit. Manual retries can create extra files, and Cloudflare lifecycle deletion is asynchronous. A bucket lock blocks object deletion and overwriting while active, but an account administrator can change the lock rules: it is not protection against every possible account takeover.
Backups are private. The report is only instructions; it does not provide public download links or reveal your secret values.
3. Check or download your backups
Quick health check in the planner
- Open Settings → General.
- Expand Data & recovery.
- Read the Backups card: last completed backup, size and recent failures.
- Expand History for reported backup and restore runs.
History is a run log, not a live inventory of files in R2. Check Cloudflare for which files still exist.
Find the actual files in Cloudflare
- Sign in at dash.cloudflare.com.
- Select the planner account: [email protected]’s Account.
- Open R2 Object Storage, then planner-backups.
- Open daily/ or monthly/.
- Choose a ZIP, open its object details, then use Download.
Filenames include the Pacific date and time: daily/planner-2026-11-20_200012.zip means a snapshot named at 8:00:12 pm on November 20. For restoration, copy its full object key, including the folder. Keep downloads private: these ZIPs contain your planner data.
To make a backup now: GitHub → Actions → Nightly backup → Run workflow → branch master.
4. Restore with GitHub
- Open the private repository makbot2000/simplysocialplanner.
- Select Actions → Restore → Run workflow.
- Choose branch master.
- Set target to
productionfor the live planner, orstagingfor a practice run. - Set file to
latest, or paste the exact R2 object key. After an incident, a specific known-good date is safer than assuming the newest backup is good. - Type
RESTORE-PRODUCTIONfor production, orRESTOREfor staging. - Leave corrupt_first off for a real recovery.
- Click Run workflow. Open the run and wait for a green result. It first downloads and checks the ZIP, saves the existing data under
pre-restore/, imports the backup, then verifies table counts. - Open the planner and check representative projects, notes, tasks and attachments. Read the email/Telegram result. If the underlying incident was a bad code release, also redeploy the matching known-good code.
The import uses --replace-all. It replaces the database tables to match the snapshot, including clearing tables absent from it. Stored files from the archive are restored; existing unrelated file blobs may remain in Convex storage. A data restore does not redeploy code or reset environment variables.
5. Undo a restore
- Open the previous restore’s GitHub log or result email.
- Find its safety-copy key, such as
pre-restore/production-2026-11-20_203000.zip. - Run Restore again with that exact key and the same target.
- Confirm using the appropriate word and wait for completion. The new restore takes another safety copy before changing anything.
If the first restore stopped before a safety copy was made, it should not have started replacing data. Inspect the run log rather than repeatedly retrying without knowing which step failed.
6. Practice on staging
Staging is intentionally disposable. A practice restore shows that an existing, damaged instance can recover from a production backup.
- Run Actions → Restore, target
staging, filelatest, confirmationRESTORE. - Tick corrupt_first to simulate a broken database. This option is rejected for production.
- The job saves a safety copy, empties staging’s projects, tasks, items and brands, then restores the backup.
- Check the green verification result and open the staging app. Large tables are counted in bounded pages; they are not silently skipped.
After the restore, staging notifications and outgoing Google task sync are switched off to avoid duplicate notifications and unintended writes to your real calendar. Production keeps its settings. A manual drill once a month is enough to keep the recovery steps familiar.
--replace-all fixed it. Those were test messages, not a production incident.7. Restore without GitHub
Use any trusted computer with Node.js, a copy of the app repository and Convex access. Your usual PC is not required. First download a ZIP from Cloudflare.
Use the repository helper
npm ci
npx convex login
npm run restore -- --target staging --local "C:/Backups/planner.zip" --confirm RESTORE
npm run restore -- --target production --local "C:/Backups/planner.zip" --confirm RESTORE-PRODUCTIONThe helper saves a pre-restore export. If R2 credentials are unavailable it keeps that safety copy on the computer running the command and prints the path. Those local copies are a fallback, not the nightly system.
Use Convex directly
If the helper is unavailable, first save the current data, then import the chosen backup. These commands target the current live deployment explicitly.
npx convex export --deployment vivid-mastiff-79 --include-file-storage --path "before-restore.zip"
npx convex import --deployment vivid-mastiff-79 --replace-all "planner.zip"The import asks for confirmation. A snapshot includes your data and uploaded files; keep both the downloaded archive and the safety export private.
8. Recover the whole app
Only the frontend is broken
In Cloudflare Pages → simply-social-planner → Deployments, select a known-good production deployment and roll back to it. This changes the frontend only. A backend code regression may also require redeploying Convex from the matching Git tag.
The database is wrong
Use the Restore workflow first. Deploy code only if the incident also involved a bad application release. Keep the code and schema compatible with the restored data.
A deployment or provider account was lost
- Recover GitHub, Cloudflare, Convex, Clerk and Google access using your password manager and account-recovery methods.
- Clone the private repository and check out a known-good release commit or tag. Install dependencies with
npm ci. - Create or select the replacement Convex deployment. Re-enter its environment variables from the password manager, especially
TOKEN_ENCRYPTION_KEYand the Clerk/owner settings. Use deployment-specific Google redirect URLs. - Deploy the backend code and schema to that explicitly selected deployment.
- Import a downloaded backup into the replacement deployment with
npx convex import --deployment NEW-DEPLOYMENT-NAME --replace-all planner.zip. The normal helper deliberately refuses unknown deployment names; update its allowlist only after verifying the new target. - Rebuild the frontend with the new
VITE_CONVEX_URL,VITE_CONVEX_SITE_URLand the correct Clerk publishable key, then deploy onlydist/to the existing Pages project. Check the custom domain. - Update GitHub secrets, the backup scripts’ deployment allowlist and provider callback URLs for the replacement. Run a fresh backup and staging restore drill.
If Clerk is recreated too, preserve or deliberately migrate the owner identity on restored records. Do not assume changing a single login setting transfers ownership of existing data.
9. Password manager checklist
Use a separate password manager such as Bitwarden or 1Password. Do not store the only recovery keys inside the planner itself. Create one secure entry for production, one for staging, and a separate entry for backup automation.
- Open Convex → the correct deployment → Settings → Environment Variables.
- Copy the current values directly into your password manager. Keep production and staging clearly labeled.
- Add provider login recovery codes and identify which Cloudflare account owns the planner and which owns the reports.
- Whenever you change a key, update the password manager and every deployment/workflow using it.
| Names to save | Why they matter |
|---|---|
TOKEN_ENCRYPTION_KEY | Decrypts saved Google and API credentials. Preserve the existing value; generating a new one is not a substitute. |
CLERK_JWT_ISSUER_DOMAIN, PLANNER_OWNER_SUBJECT, PLANNER_OWNER_EMAIL | Login verification, owner access and notification fallback. |
GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET, GOOGLE_REDIRECT_URI, GOOGLE_OAUTH_RETURN_URL | Google Calendar connection and deployment-specific callbacks. |
CLOUDFLARE_ACCOUNT_ID, CLOUDFLARE_EMAIL_API_TOKEN, NOTIFY_EMAIL_FROM, TELEGRAM_BOT_TOKEN | Email and Telegram delivery. |
VAPID_PUBLIC_KEY, VAPID_PRIVATE_KEY, VAPID_SUBJECT | Browser push notifications. |
DEV_SYNC_TOKEN | Development collector connection. |
VITE_CONVEX_URL, VITE_CONVEX_SITE_URL, VITE_CLERK_PUBLISHABLE_KEY | Frontend build configuration. Public values, but still useful for recovery. |
CONVEX_DEPLOY_KEY, CONVEX_STAGING_DEPLOY_KEY, R2_ACCESS_KEY_ID, R2_SECRET_ACCESS_KEY | Automation credentials stored in GitHub Actions secrets. R2 access is limited to this backup bucket. |
Also save any optional overrides you use, such as PLANNER_TIMEZONE, ASSISTANT_DAILY_LIMIT or LLM_THINKING. A credential change is complete only after old credentials are revoked and the new ones are tested.
10. Alerts & troubleshooting
| What you see | What it means | Next action |
|---|---|---|
| Planner backup FAILED | The export, check, upload or status-recording step failed. | Open the linked Actions run. Existing locked backups remain. Fix the issue and run Nightly backup manually. |
| Planner backups have stopped | No successful recorded backup for more than 36 hours. Checked by Convex’s daily cron. | Check Actions is enabled, secrets are valid, and account limits have not stopped the job. |
| [STAGING] Planner data was restored | A staging test replaced data successfully. | Expected during a drill. Check the workflow result and staging app. |
| Planner restore FAILED | Download, safety export, import, verification or status recording did not complete. | Read the exact step. The database may already have been imported; inspect it before retrying. Use its pre-restore file to undo if needed. |
| Table IDs conflict | A plain replace import met incompatible existing internal table IDs. | The helper uses --replace-all to handle this; confirm you are running the current workflow. |
| R2 credentials missing / access denied | Automation has no valid bucket access. | Replace the two R2 GitHub secrets using a bucket-scoped Object Read & Write token. |
Email/Telegram alerts use the planner’s notification settings. Keep those channels enabled and connected. If Convex itself is unavailable, it cannot send the app’s alerts: enable GitHub Actions failure notifications as the independent fallback. No scheduler or provider can guarantee a successful backup every night; the status checks are how you notice a missed run.
11. Setup status & sources
- Private R2 bucket, lifecycle rules, lock rules and snapshots: verified.
- Backup and restore code, Actions workflows and Settings status card: deployed.
- New deployment keys and bucket-scoped R2 credentials: configured in GitHub Actions. The old production key is revoked.
- Cloud backup run: passed — exported production and verified R2 readback.
- Cloud corruption drill: passed — emptied four staging tables and restored all 53 tables from the R2 backup.
- Nightly schedule: enabled for 8 pm Pacific. The first successful cloud run was manual; check History after the first scheduled night.
- Password-manager entries: copy and maintain them yourself; this report contains names only.
Developer instructions live in PROJECT.md, section 10. Backups and workflow logs remain private and require your provider login.
Official references: Convex backup coverage · Convex imports · R2 bucket locks · R2 lifecycle deletion.