Backups & Recovery Guide

Simply Social Planner: where your backups live, how to restore them, and how to recover the app if a deployment breaks.

8 pm
Nightly · Pacific time
14 days
Daily backup window
~3 months
Monthly safety copies
Cloud backup and recovery verified. GitHub exported production to R2, then a separate GitHub restore deliberately emptied staging’s four key tables and restored all 53 tables from that cloud backup. The nightly schedule is enabled for 8 pm Pacific; the successful cloud run was triggered manually during setup.

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

PieceRecovery sourceWhat to do
Projects, tasks, ideas, notes, settings and all other database tablesPrivate Cloudflare R2 bucket planner-backupsUse Restore.
Files uploaded to Convex storageIncluded in the same ZIPRestore imports the stored files and preserves their IDs.
Frontend, backend functions, schema and scheduled-job definitionsPrivate GitHub repository, commits and release tagsRedeploy the matching code.
Environment variables and encryption keyYour password managerRe-enter into the provider dashboards.
Logins, domain settings and the Google OAuth applicationClerk, Cloudflare and Google accountsRecover 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

  1. 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.
  2. 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.
  3. The job checks the archive and uploads it to R2. New uploads are downloaded again and compared using SHA-256 before success is reported.
  4. The planner records the result. Failures notify you by the configured email and Telegram channels. Normal successful backups are silent.
Folder in R2PurposeRetention
daily/Every successful backupDaily files expire after 14 days; locked against deletion for those 14 days.
monthly/First successful backup each monthFiles expire after 95 days; locked for 90 days. Roughly three months of protection.
pre-restore/Safety copy immediately before replacing dataExpires 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

  1. Open Settings → General.
  2. Expand Data & recovery.
  3. Read the Backups card: last completed backup, size and recent failures.
  4. 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

  1. Sign in at dash.cloudflare.com.
  2. Select the planner account: [email protected]’s Account.
  3. Open R2 Object Storage, then planner-backups.
  4. Open daily/ or monthly/.
  5. 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

This replaces database data. Use a backup from before the incident. Restoring yesterday’s backup also removes legitimate changes made after it. The workflow saves a safety copy first so you can undo the restore.
  1. Open the private repository makbot2000/simplysocialplanner.
  2. Select Actions → Restore → Run workflow.
  3. Choose branch master.
  4. Set target to production for the live planner, or staging for a practice run.
  5. 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.
  6. Type RESTORE-PRODUCTION for production, or RESTORE for staging.
  7. Leave corrupt_first off for a real recovery.
  8. 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.
  9. 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

  1. Open the previous restore’s GitHub log or result email.
  2. Find its safety-copy key, such as pre-restore/production-2026-11-20_203000.zip.
  3. Run Restore again with that exact key and the same target.
  4. 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.

  1. Run Actions → Restore, target staging, file latest, confirmation RESTORE.
  2. Tick corrupt_first to simulate a broken database. This option is rejected for production.
  3. The job saves a safety copy, empties staging’s projects, tasks, items and brands, then restores the backup.
  4. 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.

Initial drill passed. Four staging tables were emptied, then production’s snapshot restored 11 projects, 12 tasks, 789 items and 33 brands. The first attempt uncovered cross-deployment table-ID conflicts; using --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-PRODUCTION

The 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

  1. Recover GitHub, Cloudflare, Convex, Clerk and Google access using your password manager and account-recovery methods.
  2. Clone the private repository and check out a known-good release commit or tag. Install dependencies with npm ci.
  3. Create or select the replacement Convex deployment. Re-enter its environment variables from the password manager, especially TOKEN_ENCRYPTION_KEY and the Clerk/owner settings. Use deployment-specific Google redirect URLs.
  4. Deploy the backend code and schema to that explicitly selected deployment.
  5. 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.
  6. Rebuild the frontend with the new VITE_CONVEX_URL, VITE_CONVEX_SITE_URL and the correct Clerk publishable key, then deploy only dist/ to the existing Pages project. Check the custom domain.
  7. 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.

  1. Open Convex → the correct deployment → Settings → Environment Variables.
  2. Copy the current values directly into your password manager. Keep production and staging clearly labeled.
  3. Add provider login recovery codes and identify which Cloudflare account owns the planner and which owns the reports.
  4. Whenever you change a key, update the password manager and every deployment/workflow using it.
Names to saveWhy they matter
TOKEN_ENCRYPTION_KEYDecrypts 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_EMAILLogin verification, owner access and notification fallback.
GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET, GOOGLE_REDIRECT_URI, GOOGLE_OAUTH_RETURN_URLGoogle Calendar connection and deployment-specific callbacks.
CLOUDFLARE_ACCOUNT_ID, CLOUDFLARE_EMAIL_API_TOKEN, NOTIFY_EMAIL_FROM, TELEGRAM_BOT_TOKENEmail and Telegram delivery.
VAPID_PUBLIC_KEY, VAPID_PRIVATE_KEY, VAPID_SUBJECTBrowser push notifications.
DEV_SYNC_TOKENDevelopment collector connection.
VITE_CONVEX_URL, VITE_CONVEX_SITE_URL, VITE_CLERK_PUBLISHABLE_KEYFrontend build configuration. Public values, but still useful for recovery.
CONVEX_DEPLOY_KEY, CONVEX_STAGING_DEPLOY_KEY, R2_ACCESS_KEY_ID, R2_SECRET_ACCESS_KEYAutomation 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 seeWhat it meansNext action
Planner backup FAILEDThe 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 stoppedNo 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 restoredA staging test replaced data successfully.Expected during a drill. Check the workflow result and staging app.
Planner restore FAILEDDownload, 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 conflictA 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 deniedAutomation 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

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.