Blame
|
1 | # Backup & Restore |
||||||
| 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 can be automated via config file or env variables. Location is |
|||||||
| 107 | `/mnt/data/navidrome/backup`. |
|||||||
| 108 | ||||||||
|
109 | --- |
||||||
| 110 | ||||||||
|
111 | ### Miniflux ✅ |
||||||
|
112 | |||||||
|
113 | **Backups** |
||||||
| 114 | ||||||||
|
115 | [FAQ → miniflux.app](https://miniflux.app/faq.html#backup) |
||||||
| 116 | ||||||||
| 117 | [postgresql dump restore → postgresql.org](https://www.postgresql.org/docs/current/backup-dump.html) |
|||||||
| 118 | ||||||||
|
119 | Miniflux stores all it's data in a PostgreSQL db. |
||||||
| 120 | ||||||||
| 121 | We can dump it with: |
|||||||
| 122 | ||||||||
| 123 | ```bash |
|||||||
| 124 | docker compose exec -T db pg_dump -U miniflux miniflux > miniflux_backup.sql |
|||||||
| 125 | ``` |
|||||||
| 126 | ||||||||
| 127 | **Restore** |
|||||||
| 128 | ||||||||
| 129 | Start the db service: |
|||||||
|
130 | |||||||
| 131 | ```bash |
|||||||
|
132 | docker compose up -d db |
||||||
|
133 | ``` |
||||||
| 134 | ||||||||
|
135 | Then run the dump restoration command: |
||||||
| 136 | ||||||||
| 137 | ```bash |
|||||||
| 138 | cat ./miniflux_backup.sql | podman-compose exec -T db psql -U miniflux miniflux |
|||||||
| 139 | ``` |
|||||||
| 140 | ||||||||
| 141 | Then start the miniflux service: |
|||||||
| 142 | ||||||||
| 143 | ```bash |
|||||||
| 144 | docker compose up -d miniflux |
|||||||
| 145 | ``` |
|||||||
|
146 | |||||||
|
147 | --- |
||||||
| 148 | ||||||||
|
149 | ### Readeck ⚠️ |
||||||
|
150 | |||||||
| 151 | [Backups → readeck.org](https://readeck.org/en/docs/backups) |
|||||||
| 152 | ||||||||
| 153 | ```bash |
|||||||
|
154 | # docker exec -i readeck sh -c 'readeck export "/readeck/readeck_backup_$(date +%Y%m%dT%H%M%S).zip"' |
||||||
| 155 | docker compose exec app readeck export -config config.toml export.zip |
|||||||
|
156 | ``` |
||||||
| 157 | ||||||||
| 158 | to import, do the same and specifying the config file. |
|||||||
| 159 | ||||||||
| 160 | Needs to be recuring via cron job or script. Could also be built by script that |
|||||||
| 161 | does the overall backup, since backup is quick. |
|||||||
| 162 | ||||||||
|
163 | :::info |
||||||
| 164 | The export tool with docker compose exec currently does not work. |
|||||||
| 165 | ::: |
|||||||
| 166 | ||||||||
|
167 | --- |
||||||
| 168 | ||||||||
|
169 | ### Caddy |
||||||
| 170 | ||||||||
| 171 | It is sufficient to backup the `/mnt/data/caddy`. The most important folders |
|||||||
| 172 | inside are: |
|||||||
| 173 | ||||||||
| 174 | - `./Caddyfile` |
|||||||
| 175 | - `./html/` |
|||||||
| 176 | ||||||||
| 177 | To restore, the both should be in the same folder, for the Caddyfile contains |
|||||||
| 178 | the paths to the different root folders for the websites hosted. |
|||||||
| 179 | ||||||||
|
180 | --- |
||||||
| 181 | ||||||||
|
182 | ### OpenWebUI |
||||||
| 183 | ||||||||
| 184 | We do not backup the `ollama` models. We only handle the `openwebui` data. |
|||||||
| 185 | ||||||||
| 186 | ||||||||
| 187 | - [Backing Up Your Instance - openwebUI docs](https://docs.openwebui.com/tutorials/maintenance/backups/#scripting-a-backup-job) |
|||||||
| 188 | ||||||||
| 189 | ||||||||
| 190 | **Dir structure**: |
|||||||
| 191 | ``` |
|||||||
| 192 | ├── audit.log |
|||||||
| 193 | ├── cache/ |
|||||||
| 194 | ├── uploads/ |
|||||||
| 195 | ├── vector_db/ |
|||||||
| 196 | └── webui.db |
|||||||
| 197 | ``` |
|||||||
| 198 | ||||||||
|
199 | 1. Cold backup approach - Stops the container before backup for data integrity |
||||||
| 200 | 2. Copies the entire `/webui` folder including: |
|||||||
| 201 | - webui.db (main database with chats, users, settings) |
|||||||
| 202 | - uploads/ (uploaded files) |
|||||||
| 203 | - cache/ (cached data) |
|||||||
| 204 | - vector_db/ (RAG/Knowledge embeddings) |
|||||||
|
205 | |||||||
|
206 | --- |
||||||
|
207 | |||||||
|
208 | ## Missing or broken installs |
||||||
| 209 | ||||||||
| 210 | - archivebox |
|||||||
| 211 | - bookstack |
|||||||
| 212 | - etherpad |
|||||||
| 213 | - synapse |
|||||||