docs: enhance Docker installation and migration documentation with updated steps and options for managing updates

This commit is contained in:
Anish Sarkar 2026-02-26 19:11:57 +05:30
parent 90f18fac38
commit 2e8e85a4ef
2 changed files with 51 additions and 33 deletions

View file

@ -85,7 +85,15 @@ bash migrate-database.sh --db-user myuser --db-password mypass --db-name mydb
For users who prefer full control or whose platform doesn't support bash scripts (e.g. Windows without WSL2).
### Step 1 — Start a temporary PostgreSQL 14 container
### Step 1 — Stop the old all-in-one container
Before mounting the `surfsense-data` volume into a new container, stop the existing one to prevent two PostgreSQL processes from writing to the same data directory:
```bash
docker stop surfsense 2>/dev/null || true
```
### Step 2 — Start a temporary PostgreSQL 14 container
```bash
docker run -d --name surfsense-pg14-temp \
@ -103,20 +111,20 @@ Wait ~10 seconds, then confirm it is healthy:
docker exec surfsense-pg14-temp pg_isready -U surfsense
```
### Step 2 — Dump the database
### Step 3 — Dump the database
```bash
docker exec -e PGPASSWORD=surfsense surfsense-pg14-temp \
pg_dump -U surfsense surfsense > surfsense_backup.sql
```
### Step 3 — Recover your SECRET\_KEY
### Step 4 — Recover your SECRET\_KEY
```bash
docker run --rm -v surfsense-data:/data alpine cat /data/.secret_key
```
### Step 4 — Set up the new stack
### Step 5 — Set up the new stack
```bash
mkdir -p surfsense/scripts
@ -128,9 +136,9 @@ chmod +x surfsense/scripts/init-electric-user.sh
cp surfsense/.env.example surfsense/.env
```
Set `SECRET_KEY` in `surfsense/.env` to the value from Step 3.
Set `SECRET_KEY` in `surfsense/.env` to the value from Step 4.
### Step 5 — Start PostgreSQL 17 and restore
### Step 6 — Start PostgreSQL 17 and restore
```bash
cd surfsense
@ -139,13 +147,13 @@ docker compose exec db pg_isready -U surfsense # wait until ready
docker compose exec -T db psql -U surfsense -d surfsense < ../surfsense_backup.sql
```
### Step 6 — Start all services
### Step 7 — Start all services
```bash
docker compose up -d
```
### Step 7 — Clean up
### Step 8 — Clean up
```bash
docker stop surfsense-pg14-temp && docker rm surfsense-pg14-temp