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 | docker compose exec -u git forgejo forgejo dump --file /tmp/forgejo-dump.zip |
||||||
|
37 | ``` |
||||||
|
38 | Then copy out the file and rename it at the same time: |
||||||
| 39 | ||||||||
| 40 | ```bash |
|||||||
| 41 | docker compose cp forgejo:/tmp/forgejo-dump.zip /mnt/data/backups/forgejo/forgejo-backup-$(date +%Y%m%d-%H%M%S).zip |
|||||||
| 42 | ``` |
|||||||
| 43 | ||||||||
| 44 | Pour finir, on supprime l'archive du dossier /tmp dans le container: |
|||||||
| 45 | ||||||||
| 46 | ```bash |
|||||||
| 47 | docker compose exec forgejo rm /tmp/forgejo-dump.zip |
|||||||
| 48 | ``` |
|||||||
| 49 | ||||||||
|
50 | **Restore** |
||||||
|
51 | |||||||
|
52 | Move all relevant files to their location in the mounted volumes: |
||||||
| 53 | ||||||||
| 54 | ```bash |
|||||||
| 55 | ||||||||
| 56 | docker compose up |
|||||||
| 57 | # Arreter un peu après. C'est pour générer la structure de dossiers. |
|||||||
| 58 | unzip forgejo-dump-1610949662.zip |
|||||||
| 59 | cd forgejo-dump-1610949662 |
|||||||
| 60 | mv app.ini $FORGEJO_DATA_DIR/gitea/conf/app.ini |
|||||||
| 61 | mv data/* $FORGEJO_DATA_DIR/gitea/data/ |
|||||||
| 62 | mv log/* $FORGEJO_DATA_DIR/gitea/log/ |
|||||||
| 63 | mv repos/* $FORGEJO_DATA_DIR/git/repositories/ |
|||||||
| 64 | chown -R docker:docker $FORGEJO_DATA_DIR/ |
|||||||
| 65 | ||||||||
| 66 | # Je garde les commandes ci-dessous comme archives. La db se trouve déjà dans data/. |
|||||||
| 67 | # De fait, on peut s'arrêter là, et on a pas besoin du dump, car sqlite3 est en format single file. |
|||||||
| 68 | ||||||||
| 69 | # sqlite3 |
|||||||
| 70 | # sqlite3 $DATABASE_PATH <gitea-db.sql |
|||||||
| 71 | ||||||||
| 72 | # Commandes pour d'autres types de DB: |
|||||||
| 73 | # mysql |
|||||||
| 74 | # mysql --default-character-set=utf8mb4 -u$USER -p$PASS $DATABASE <gitea-db.sql |
|||||||
| 75 | # postgres |
|||||||
| 76 | # psql -U $USER -d $DATABASE < gitea-db.sql |
|||||||
| 77 | ||||||||
| 78 | ``` |
|||||||
|
79 | |||||||
|
80 | --- |
||||||
|
81 | |||||||
|
82 | ### Jellyfin |
||||||
| 83 | ||||||||
| 84 | [Backup and Restore → jellyfin.org](https://jellyfin.org/docs/general/administration/backup-and-restore) |
|||||||
| 85 | ||||||||
| 86 | Stop the container completly, then copy the config folder (maybe nothing else ?) |
|||||||
| 87 | → `/mnt/data/jellyfin/config` |
|||||||
| 88 | ||||||||
|
89 | --- |
||||||
| 90 | ||||||||
|
91 | ### Kavita |
||||||
| 92 | ||||||||
| 93 | [Backups → wiki.kavitareader.com](https://wiki.kavitareader.com/guides/admin-settings/tasks/#kavita-backup) |
|||||||
| 94 | ||||||||
| 95 | Backups are already generated, in `/mnt/data/kavita/config/backups`. |
|||||||
| 96 | ||||||||
|
97 | --- |
||||||
| 98 | ||||||||
|
99 | ### Navidrome |
||||||
| 100 | ||||||||
| 101 | [Automated Backup → navidrome.org](https://www.navidrome.org/docs/usage/backup/) |
|||||||
| 102 | ||||||||
| 103 | Backup can be automated via config file or env variables. Location is |
|||||||
| 104 | `/mnt/data/navidrome/backup`. |
|||||||
| 105 | ||||||||
|
106 | --- |
||||||
| 107 | ||||||||
|
108 | ### Miniflux |
||||||
| 109 | ||||||||
|
110 | **Backups** |
||||||
| 111 | ||||||||
|
112 | [FAQ → miniflux.app](https://miniflux.app/faq.html#backup) |
||||||
| 113 | ||||||||
| 114 | [postgresql dump restore → postgresql.org](https://www.postgresql.org/docs/current/backup-dump.html) |
|||||||
| 115 | ||||||||
|
116 | Miniflux stores all it's data in a PostgreSQL db. |
||||||
| 117 | ||||||||
| 118 | We can dump it with: |
|||||||
| 119 | ||||||||
| 120 | ```bash |
|||||||
| 121 | docker compose exec -T db pg_dump -U miniflux miniflux > miniflux_backup.sql |
|||||||
| 122 | ``` |
|||||||
| 123 | ||||||||
| 124 | **Restore** |
|||||||
| 125 | ||||||||
| 126 | Start the db service: |
|||||||
|
127 | |||||||
| 128 | ```bash |
|||||||
|
129 | docker compose up -d db |
||||||
|
130 | ``` |
||||||
| 131 | ||||||||
|
132 | Then run the dump restoration command: |
||||||
| 133 | ||||||||
| 134 | ```bash |
|||||||
| 135 | cat ./miniflux_backup.sql | podman-compose exec -T db psql -U miniflux miniflux |
|||||||
| 136 | ``` |
|||||||
| 137 | ||||||||
| 138 | Then start the miniflux service: |
|||||||
| 139 | ||||||||
| 140 | ```bash |
|||||||
| 141 | docker compose up -d miniflux |
|||||||
| 142 | ``` |
|||||||
|
143 | |||||||
|
144 | --- |
||||||
| 145 | ||||||||
|
146 | ### Readeck |
||||||
| 147 | ||||||||
| 148 | [Backups → readeck.org](https://readeck.org/en/docs/backups) |
|||||||
| 149 | ||||||||
| 150 | ```bash |
|||||||
| 151 | docker exec -i readeck sh -c 'readeck export "/readeck/readeck_backup_$(date +%Y%m%dT%H%M%S).zip"' |
|||||||
| 152 | ``` |
|||||||
| 153 | ||||||||
| 154 | to import, do the same and specifying the config file. |
|||||||
| 155 | ||||||||
| 156 | Needs to be recuring via cron job or script. Could also be built by script that |
|||||||
| 157 | does the overall backup, since backup is quick. |
|||||||
| 158 | ||||||||
|
159 | --- |
||||||
| 160 | ||||||||
|
161 | ### Caddy |
||||||
| 162 | ||||||||
| 163 | It is sufficient to backup the `/mnt/data/caddy`. The most important folders |
|||||||
| 164 | inside are: |
|||||||
| 165 | ||||||||
| 166 | - `./Caddyfile` |
|||||||
| 167 | - `./html/` |
|||||||
| 168 | ||||||||
| 169 | To restore, the both should be in the same folder, for the Caddyfile contains |
|||||||
| 170 | the paths to the different root folders for the websites hosted. |
|||||||
| 171 | ||||||||
|
172 | --- |
||||||
| 173 | ||||||||
|
174 | ### OpenWebUI |
||||||
| 175 | ||||||||
| 176 | We do not backup the `ollama` models. We only handle the `openwebui` data. |
|||||||
| 177 | ||||||||
| 178 | ||||||||
| 179 | - [Backing Up Your Instance - openwebUI docs](https://docs.openwebui.com/tutorials/maintenance/backups/#scripting-a-backup-job) |
|||||||
| 180 | ||||||||
| 181 | ||||||||
| 182 | **Dir structure**: |
|||||||
| 183 | ``` |
|||||||
| 184 | ├── audit.log |
|||||||
| 185 | ├── cache/ |
|||||||
| 186 | ├── uploads/ |
|||||||
| 187 | ├── vector_db/ |
|||||||
| 188 | └── webui.db |
|||||||
| 189 | ``` |
|||||||
| 190 | ||||||||
|
191 | 1. Cold backup approach - Stops the container before backup for data integrity |
||||||
| 192 | 2. Copies the entire `/webui` folder including: |
|||||||
| 193 | - webui.db (main database with chats, users, settings) |
|||||||
| 194 | - uploads/ (uploaded files) |
|||||||
| 195 | - cache/ (cached data) |
|||||||
| 196 | - vector_db/ (RAG/Knowledge embeddings) |
|||||||
|
197 | |||||||
|
198 | --- |
||||||
|
199 | |||||||
|
200 | ## Missing or broken installs |
||||||
| 201 | ||||||||
| 202 | - archivebox |
|||||||
| 203 | - bookstack |
|||||||
| 204 | - etherpad |
|||||||
| 205 | - synapse |
|||||||