Blame

e33cd0 theophile 2025-10-12 22:02:27
test
1
# Backups & Restore des services individuels
2
3
Cette page est dédier à la sauvegarde et restoration des services sur le serveur.
4
5
## Services
6
> [!NOTE]
7
> As of _25/08/08_ → **20 GiB** approximatly. It should not grow very fast, since it is
8
> mostly configuration files and a text wiki.
9
10
**Large Media** is backed up seperatly when necessary:
11
12
- jellyfin
13
- navidrome
14
15
:::warning
16
# Stop containers before making backups.
17
This is safer for data.
18
:::
19
20
---
21
22
### Otterwiki ✅
23
24
OtterWiki being a flatfile wiki, we can back it up by simply copying the
25
`/mnt/data/otterwiki` folder and restoring it.
26
27
---
28
29
### Forgejo ✅
30
31
**Backup**
32
33
[Based on the documentation](https://forgejo.org/docs/latest/admin/upgrade/#backup) and [this analysis of gitea backups](https://codeberg.org/forgejo/forgejo/src/tag/v1.21.3-0/docs/content/administration/backup-and-restore.en-us.md), we can run
34
35
```bash
36
37
docker compose exec -u git forgejo forgejo dump --file /tmp/forgejo-dump.zip
38
39
```
40
41
Then copy out the file and rename it at the same time:
42
43
```bash
44
docker compose cp forgejo:/tmp/forgejo-dump.zip /mnt/data/backups/forgejo/forgejo-backup-$(date +%Y%m%d-%H%M%S).zip
45
```
46
47
Pour finir, on supprime l'archive du dossier /tmp dans le container:
48
49
```bash
50
docker compose exec forgejo rm /tmp/forgejo-dump.zip
51
```
52
53
**Restore**
54
55
Move all relevant files to their location in the mounted volumes:
56
57
```bash
58
59
docker compose up
60
# Arreter un peu après. C'est pour générer la structure de dossiers.
61
unzip forgejo-dump-1610949662.zip
62
cd forgejo-dump-1610949662
63
mv app.ini $FORGEJO_DATA_DIR/gitea/conf/app.ini
64
mv data/* $FORGEJO_DATA_DIR/gitea/data/
65
mv log/* $FORGEJO_DATA_DIR/gitea/log/
66
mv repos/* $FORGEJO_DATA_DIR/git/repositories/
67
chown -R docker:docker $FORGEJO_DATA_DIR/
68
69
# Je garde les commandes ci-dessous comme archives. La db se trouve déjà dans data/.
70
# De fait, on peut s'arrêter là, et on a pas besoin du dump, car sqlite3 est en format single file.
71
72
# sqlite3
73
# sqlite3 $DATABASE_PATH <gitea-db.sql
74
75
# Commandes pour d'autres types de DB:
76
# mysql
77
# mysql --default-character-set=utf8mb4 -u$USER -p$PASS $DATABASE <gitea-db.sql
78
# postgres
79
# psql -U $USER -d $DATABASE < gitea-db.sql
80
81
```
82
83
---
84
85
### Jellyfin
86
87
[Backup and Restore → jellyfin.org](https://jellyfin.org/docs/general/administration/backup-and-restore)
88
89
Stop the container completly, then copy the config folder (maybe nothing else ?)
90
`/mnt/data/jellyfin/config`
91
92
---
93
94
### Kavita
95
96
[Backups → wiki.kavitareader.com](https://wiki.kavitareader.com/guides/admin-settings/tasks/#kavita-backup)
97
98
Backups are already generated, in `/mnt/data/kavita/config/backups`.
99
100
---
101
102
### Navidrome
103
104
[Automated Backup → navidrome.org](https://www.navidrome.org/docs/usage/backup/)
105
106
#### Backup
107
108
Backup can be automated via config file or env variables. Location is
109
`/mnt/data/navidrome/backup`.
110
111
Alternatively, we can also directly start a backup from inside the container:
112
113
```bash
114
sudo docker compose run <service_name> backup create
115
# service_name is usually `navidrome`
116
```
117
118
We can also prune old backups with:
119
120
```bash
121
sudo docker compose run <service_name> backup prune
122
# service_name is usually `navidrome`
123
```
124
#### Restore
125
126
When you restore a backup, the existing data in the database is wiped and the data in the backup gets copied into the database.
127
128
Note: YOU MUST BE SURE TO RUN THIS COMMAND WHILE THE NAVIDROME APP IS NOT RUNNING/LIVE.
129
130
Restore a backup by running the navidrome backup restore command.
131
:::warning
132
Attention
133
Restoring a backup should ONLY be done when the service is NOT running. You’ve been warned.
134
:::
135
136
---
137
138
### Miniflux ✅
139
140
**Backups**
141
142
[FAQ → miniflux.app](https://miniflux.app/faq.html#backup)
143
144
[postgresql dump restore → postgresql.org](https://www.postgresql.org/docs/current/backup-dump.html)
145
146
Miniflux stores all it's data in a PostgreSQL db.
147
148
We can dump it with:
149
150
```bash
151
docker compose exec -T db pg_dump -U miniflux miniflux > miniflux_backup.sql
152
```
153
154
**Restore**
155
156
Start the db service:
157
158
```bash
159
docker compose up -d db
160
```
161
162
Then run the dump restoration command:
163
164
```bash
165
cat ./miniflux_backup.sql | podman-compose exec -T db psql -U miniflux miniflux
166
```
167
168
Then start the miniflux service:
169
170
```bash
171
docker compose up -d miniflux
172
```
173
174
---
175
176
### Readeck ⚠️
177
178
[Backups → readeck.org](https://readeck.org/en/docs/backups)
179
180
```bash
181
# docker exec -i readeck sh -c 'readeck export "/readeck/readeck_backup_$(date +%Y%m%dT%H%M%S).zip"'
182
docker compose exec app readeck export -config config.toml export.zip
183
```
184
185
to import, do the same and specifying the config file.
186
187
Needs to be recuring via cron job or script. Could also be built by script that
188
does the overall backup, since backup is quick.
189
190
:::info
191
The export tool with docker compose exec currently does not work.
192
:::
193
194
---
195
196
### Caddy
197
198
It is sufficient to backup the `/mnt/data/caddy`. The most important folders
199
inside are:
200
201
- `./Caddyfile`
202
- `./html/`
203
204
To restore, the both should be in the same folder, for the Caddyfile contains
205
the paths to the different root folders for the websites hosted.
206
207
---
208
209
### OpenWebUI
210
211
We do not backup the `ollama` models. We only handle the `openwebui` data.
212
213
214
- [Backing Up Your Instance - openwebUI docs](https://docs.openwebui.com/tutorials/maintenance/backups/#scripting-a-backup-job)
215
216
217
**Dir structure**:
218
```
219
├── audit.log
220
├── cache/
221
├── uploads/
222
├── vector_db/
223
└── webui.db
224
```
225
226
1. Cold backup approach - Stops the container before backup for data integrity
227
2. Copies the entire `/webui` folder including:
228
- webui.db (main database with chats, users, settings)
229
- uploads/ (uploaded files)
230
- cache/ (cached data)
231
- vector_db/ (RAG/Knowledge embeddings)
232
233
---
234
235
### Medama
236
237
n.a.
238
239
---
240
241
## Missing or broken installs
242
243
- archivebox
244
- bookstack
245
- etherpad
246
- synapse