{"success":true,"name":"backup-right-before-you-change-and-write-down-where-it-is-an","description":"About to change database data or structure without a fresh backup taken just now","category":"ai-brimind","path":"ai-brimind/backup-right-before-you-change-and-write-down-where-it-is-an/SKILL.md","file":"SKILL.md","content":"---\nname: backup-right-before-you-change-and-write-down-where-it-is-an\ndescription: \"About to change database data or structure without a fresh backup taken just now\"\n---\n\n# Backup Right Before You Change, and Write Down Where It Is and How to Restore It\n\n## When to use\nYou are about to modify a database (migration, bulk update, delete, schema change, backfill) and there is no backup taken immediately before THIS specific change — or the backup exists but nobody wrote down its location and restore command.\n\n## Example request\nA migration is run trusting last night's automatic backup → everything written today would be lost on restore; a nightly backup protects yesterday, only a fresh one protects now. A backup file exists somewhere → during the incident, ten panicked minutes are spent searching disks for it; a backup nobody can find is a backup that does not exist. The dump is saved but the restore command was never noted → at 2am someone guesses flags on a tool they never used; the restore instructions are part of the backup. Change goes fine → the note with backup path and restore command took two minutes and cost nothing; that is the correct price of insurance.\n\n## Instructions\nAct as someone who assumes the change WILL go wrong and prepares the way back before taking a single step forward. Before any operation that modifies a real database, do this — in order, no skipping: (1) Take a FRESH backup now, of the exact data the change will touch (the whole database, or at minimum the affected tables/collections). Use the standard tool for your stack (pg_dump for Postgres, mongodump for MongoDB, your host's snapshot feature) — never a hand-rolled export. (2) Name it so it explains itself: include the date, time, and reason, e.g. backup_2026-07-03_before-skills-backfill.dump — a file called dump.bak found in six months is a mystery, not a safety net. (3) WRITE DOWN, in the change note / commit message / runbook, three things: the FULL PATH where the backup lives (and it must live somewhere the incident cannot destroy — not only on the same machine as the database), the EXACT restore command copy-paste ready (e.g. pg_restore -d mydb /backups/backup_2026-07-03_before-skills-backfill.dump, or mongorestore --drop /backups/2026-07-03_before-backfill/), and WHAT it contains (which db/tables, taken at what time). (4) Verify the backup is real before touching anything: check the file is not zero bytes and, for anything important, that the tool can read it back — a corrupted backup discovered during the emergency is worse than none, because you trusted it. (5) Only then run the change. Only call this done once someone who is NOT you could, using only your note, find the backup and restore it — if restoring still requires your memory, the safety net is you, not the backup.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #607\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}