From f70cbb1efaf370d1f6e4fa76ad98fdf80dd66a45 Mon Sep 17 00:00:00 2001 From: spelingbee Date: Fri, 4 Sep 2026 15:40:24 +0600 Subject: [PATCH 1/2] docs: deploy pages link Backup & Restore, and it names the -wal The two Docker deploy pages now link Backup & Restore where they say "have backups" / "back up both the database and any local assets", and that page's "What to back up" list says that with SQLite the database means `memos_prod.db` together with its `-wal` and `-shm` files, or a `.backup` copy. Read on its own, "the database" is the one file that on a running instance holds almost nothing (4 KiB against a 160 KiB `-wal` on a fresh 0.30.0 in my test), and the deploy pages are the ones a Docker user reads. Three lines, no new page. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_0193orVXP78niTTs6AzLThHK --- content/docs/deploy/docker-compose.mdx | 2 +- content/docs/deploy/docker.mdx | 2 +- content/docs/operations/backup-restore.mdx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/content/docs/deploy/docker-compose.mdx b/content/docs/deploy/docker-compose.mdx index 61c12d94..d6de7366 100644 --- a/content/docs/deploy/docker-compose.mdx +++ b/content/docs/deploy/docker-compose.mdx @@ -50,7 +50,7 @@ docker compose up -d - keep your data directory on persistent storage - place Memos behind a reverse proxy for HTTPS - leave `MEMOS_INSTANCE_URL` empty for private mode, or set it to the canonical public URL to enable anonymous public access -- back up both the database and any local assets if you do not use database-backed attachment storage +- back up both the database and any local assets if you do not use database-backed attachment storage - see [Backup & Restore](/docs/operations/backup-restore) for how; with SQLite, copying `memos_prod.db` on its own while Memos is running misses everything still in its `-wal` file ## When to add more services diff --git a/content/docs/deploy/docker.mdx b/content/docs/deploy/docker.mdx index f9c5a0ff..e20cf8c2 100644 --- a/content/docs/deploy/docker.mdx +++ b/content/docs/deploy/docker.mdx @@ -163,4 +163,4 @@ docker run -d \ neosmemo/memos:stable ``` -Because data is stored in the mounted volume, replacing the container is usually safe as long as you keep the same data directory and have backups. +Because data is stored in the mounted volume, replacing the container is usually safe as long as you keep the same data directory and have backups. See [Backup & Restore](/docs/operations/backup-restore) for what to back up and how. diff --git a/content/docs/operations/backup-restore.mdx b/content/docs/operations/backup-restore.mdx index af07bd57..ef18b96f 100644 --- a/content/docs/operations/backup-restore.mdx +++ b/content/docs/operations/backup-restore.mdx @@ -17,7 +17,7 @@ The location is controlled by `MEMOS_DATA`. Override it at runtime or use the de ## What to back up -- the database itself +- the database itself - with SQLite, `memos_prod.db` together with its `-wal` and `-shm` files, or a copy made with `.backup` as below; on a running instance the newest rows are in the `-wal` until SQLite checkpoints them - local attachment storage when attachments are not stored in the database - deployment configuration such as environment variables, compose files, and proxy config From 8e2179e146c48299e5cd4c791582738760e67543 Mon Sep 17 00:00:00 2001 From: spelingbee Date: Sat, 5 Sep 2026 13:00:54 +0600 Subject: [PATCH 2/2] docs: the .backup example writes to $HOME, because ~ is not expanded inside the quotes As written, sqlite3 ~/.memos/memos_prod.db ".backup ~/.memos/memos_backup.db" fails with 'Error: cannot open "~/.memos/memos_backup.db"' (sqlite 3.45.3): neither the shell nor sqlite3 expands ~ inside a double-quoted argument. $HOME is expanded by the shell before sqlite3 sees it, and is what the cron script further down the page already does with $MEMOS_DATA. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01Y4L8FgyAaUQV4X8kVnQz2P --- content/docs/operations/backup-restore.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/docs/operations/backup-restore.mdx b/content/docs/operations/backup-restore.mdx index ef18b96f..977eae0e 100644 --- a/content/docs/operations/backup-restore.mdx +++ b/content/docs/operations/backup-restore.mdx @@ -34,7 +34,7 @@ sudo systemctl start memos For online backups while Memos is running, use SQLite's built-in `.backup` command which handles WAL mode correctly: ```bash -sqlite3 ~/.memos/memos_prod.db ".backup ~/.memos/memos_backup.db" +sqlite3 ~/.memos/memos_prod.db ".backup $HOME/.memos/memos_backup.db" ``` Automated daily backup with 7-day retention: