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