From 35675b08988cf5f595c2ca27abfc31e0eab7cafe Mon Sep 17 00:00:00 2001 From: you Date: Wed, 25 Mar 2026 00:46:04 +0000 Subject: [PATCH] =?UTF-8?q?docs:=20simplify=20backup/update=20sections=20?= =?UTF-8?q?=E2=80=94=20use=20manage.sh,=20drop=20volume=20inspect?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Backup section now shows manage.sh commands instead of raw docker volume inspect paths. Update section is one command. --- docs/DEPLOYMENT.md | 53 ++++++++++++---------------------------------- 1 file changed, 13 insertions(+), 40 deletions(-) diff --git a/docs/DEPLOYMENT.md b/docs/DEPLOYMENT.md index 5e3ab2ff..a2e93d28 100644 --- a/docs/DEPLOYMENT.md +++ b/docs/DEPLOYMENT.md @@ -326,63 +326,36 @@ Don't expose 1883 at all. Instead, have your observers publish to a shared publi ## Database Backups -Packet data is stored in `meshcore.db` inside the `meshcore-data` Docker volume. +Packet data is stored in `meshcore.db` inside the data volume. -### Find the database file +**Using manage.sh (easiest):** ```bash -docker volume inspect meshcore-data --format '{{ .Mountpoint }}' -# Prints something like: /var/lib/docker/volumes/meshcore-data/_data +./manage.sh backup # Saves to ./backups/meshcore-TIMESTAMP.db +./manage.sh backup ~/my-backup.db # Custom path +./manage.sh restore ./backups/some-file.db # Restore (backs up current DB first) ``` -The database is at that path + `/meshcore.db`. +**Local directory mount (recommended):** -### Manual backup +If you used `-v ./analyzer-data:/app/data` instead of a Docker volume, the database is just `./analyzer-data/meshcore.db` — back it up however you like. -```bash -cp $(docker volume inspect meshcore-data --format '{{ .Mountpoint }}')/meshcore.db \ - ~/meshcore-backup-$(date +%Y%m%d).db -``` - -### Automated daily backup (cron) +**Automated daily backup (cron):** ```bash crontab -e -# Add this line: -0 3 * * * cp $(docker volume inspect meshcore-data --format '\{\{ .Mountpoint \}\}')/meshcore.db /home/youruser/backups/meshcore-$(date +\%Y\%m\%d).db -``` - -### Easier alternative: use a local directory - -Instead of a Docker volume, mount a local directory. Replace `-v meshcore-data:/app/data` with: - -```bash --v ./analyzer-data:/app/data -``` - -Now the database is just `./analyzer-data/meshcore.db` — easy to find, back up, and restore. - -### Restoring from backup - -Stop the container, replace `meshcore.db` with your backup file, start the container: - -```bash -docker stop meshcore-analyzer -cp ~/meshcore-backup-20260324.db $(docker volume inspect meshcore-data --format '{{ .Mountpoint }}')/meshcore.db -docker start meshcore-analyzer +# Add: +0 3 * * * cd /path/to/meshcore-analyzer && ./manage.sh backup ``` ## Updating ```bash -cd meshcore-analyzer -git pull -docker build -t meshcore-analyzer . -docker stop meshcore-analyzer -docker rm meshcore-analyzer -# Re-run the same docker run command from Quick Start step 4 +./manage.sh update ``` +Pulls latest code, rebuilds the image, restarts the container. Data is preserved. + Data is preserved in the Docker volumes. **Tip:** Save your `docker run` command in a script (`run.sh`) so you don't have to remember all the flags.