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