GRiMbot documentation

Back Up

This is the hosted copy of the GRiMbot technical manual. Use the table of contents to open any page in the manual.

Back Up

A Back Up is a copy of the files required to Restore GRiMbot on the same kind of packaged install.

The database is the part that changes while GRiMbot runs, so GRiMbot copies it itself. Every night at 04:20 in your Bot Timezone it writes a dated copy into data/snapshots/, checks that copy, and keeps the last 14. You can take one whenever you want from System → Database: click Snapshot now and read the answer.

Copying files by hand is still how the rest is backed up: .env, data/media-clips/, and the plugin and game JSON.

What to copy

Copy the whole set. A partial copy is not a verified Back Up.

Item Required
.env Yes
data/grimbot.db Yes for SQLite packaged installs
data/snapshots/ Recommended. These are GRiMbot's own dated copies, checked when taken
data/media-clips/ Yes if you use Media Library
data/ plugin and game JSON Yes if you use plugins or Chat Games
Plugin zip originals Recommended. Runtime copies live under data/plugins/installed/

Do not copy runtime/ from a packaged Core unless you are cloning the entire install. The database and .env are the recovery core.

Procedure

  1. Note the GRiMbot version from About or the package name.
  2. Open System → Database and click Snapshot now. A line comes back with the copy's name, its size, and a word: ok means the copy opened and passed its own check.
  3. Keep the set that copy made: grimbot-YYYYMMDD-HHMMSS.db, the .json record beside it, and the .sha256 checksum beside it. Copy all three, not just the .db.
  4. Copy .env and the rest of data/ to offline storage you control.
  5. Confirm the copy sizes match the source.
  6. Store the copy away from the install disk.
  7. Record the date and GRiMbot version with the copy.

A copy taken during a stream is skipped and lands in the next dead hour, so a night you streamed has a copy from the following quiet hour. The Database window shows when the newest copy was taken.

Older installs without the Database window: stop GRiMbot when you can. If you must copy while it runs, copy data/grimbot.db twice and keep both timestamps.

On a git checkout the same copy can be taken from a terminal, and asked about later:

bash scripts/db-snapshot.sh              # take one now
bash scripts/db-snapshot.sh --status     # newest copy and its age
bash scripts/db-snapshot.sh --list       # every copy kept
bash scripts/db-snapshot.sh --verify     # newest copy: checksum and its own check

SECURITY

Encrypt the Back Up if it leaves the host. Anyone with .env and the database can impersonate the bot. A copy in data/snapshots/ holds the same saved logins and tokens as the live database, so it is the same secret. Treat it like .env.

Verification

GRiMbot checks every copy it takes by opening that copy and reading it. The Database window prints the verdict in the Check column of the copies list: ok, or what went wrong.

A Back Up is verified only after a Restore test on a spare folder or spare machine. File copy success is not Restore success.

Check now in the Database window is a different thing: it inspects the database you are using, not a copy. It reports damage, rows that point at a parent that is not there, and values stored as the wrong type.

Related pages