From 3cb6c43c528f7508cd7177d8aac5ca8ea8a85134 Mon Sep 17 00:00:00 2001 From: you Date: Wed, 25 Mar 2026 00:35:32 +0000 Subject: [PATCH] =?UTF-8?q?docs:=20fix=20backup=20instructions=20=E2=80=94?= =?UTF-8?q?=20DB=20is=20on=20volume,=20not=20inside=20container?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/DEPLOYMENT.md | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/docs/DEPLOYMENT.md b/docs/DEPLOYMENT.md index 2f7a33e..0bf8735 100644 --- a/docs/DEPLOYMENT.md +++ b/docs/DEPLOYMENT.md @@ -264,23 +264,31 @@ The built-in MQTT broker (Mosquitto) runs on port 1883 with **anonymous access e ### ⚠️ Database backups -Your packet data lives in `/app/data/meshcore.db` (a SQLite file inside the `meshcore-data` Docker volume). If the volume is deleted, all data is gone. +Your packet data lives in `meshcore.db` inside the `meshcore-data` Docker volume. If the volume is deleted, all data is gone. -**Backup regularly:** +**Find your database file:** ```bash -# Copy the database out of the container -docker cp meshcore-analyzer:/app/data/meshcore.db ./meshcore-backup-$(date +%Y%m%d).db +# Show where Docker stores the volume on disk +docker volume inspect meshcore-data --format '{{ .Mountpoint }}' +# e.g., /var/lib/docker/volumes/meshcore-data/_data/meshcore.db +``` + +**Back it up:** + +```bash +# Copy the DB to a backup location +cp $(docker volume inspect meshcore-data --format '{{ .Mountpoint }}')/meshcore.db ~/meshcore-backup-$(date +%Y%m%d).db ``` **Automate with cron (recommended):** ```bash # Add to crontab: daily backup at 3am -0 3 * * * docker cp meshcore-analyzer:/app/data/meshcore.db /home/youruser/backups/meshcore-$(date +\%Y\%m\%d).db +0 3 * * * cp $(docker volume inspect meshcore-data --format '\{\{ .Mountpoint \}\}')/meshcore.db /home/youruser/backups/meshcore-$(date +\%Y\%m\%d).db ``` -Keep at least 7 days of backups. SQLite files are portable — you can copy them to another machine and restore by simply placing the file back. +**Tip:** If you'd rather mount a local directory instead of a Docker volume (easier to find and back up), replace `-v meshcore-data:/app/data` with `-v ./analyzer-data:/app/data` in the docker run command. ### ⚠️ Domain DNS must be configured BEFORE starting the container