fix(docs): restore backups without helper script
This commit is contained in:
@@ -468,14 +468,18 @@ Admins can also download a backup from **Settings → Backup Management**.
|
||||
|
||||
### Restore
|
||||
|
||||
Admins can restore a backup from **Settings → Backup Management**. For operational restores via Docker Compose, stop the running app, mount the backup into a temporary container that uses the same Docker volume, and run the restore helper:
|
||||
Admins can restore a backup from **Settings → Backup Management**. For operational restores via Docker Compose, stop the running app, mount the backup into a temporary container that uses the same Docker volume, and replace the database file:
|
||||
|
||||
```bash
|
||||
docker compose stop oikos
|
||||
docker compose run --rm -v "$PWD/oikos-backup-20260401.db:/tmp/oikos-restore.db:ro" oikos node scripts/restore-backup.js /tmp/oikos-restore.db
|
||||
docker compose up -d
|
||||
SERVICE=oikos
|
||||
BACKUP="$PWD/oikos-backup-20260401.db"
|
||||
docker compose stop "$SERVICE"
|
||||
docker compose run --rm -v "$BACKUP:/tmp/oikos-restore.db:ro" --entrypoint sh "$SERVICE" -c 'set -eu; target="${DB_PATH:-/data/oikos.db}"; stamp=$(date -u +%Y%m%dT%H%M%SZ); if [ -f "$target" ]; then cp "$target" "$target.pre-restore-$stamp"; fi; rm -f "$target-wal" "$target-shm"; cp /tmp/oikos-restore.db "$target"; chown node:node "$target" 2>/dev/null || true'
|
||||
docker compose up -d "$SERVICE"
|
||||
```
|
||||
|
||||
If your Compose service is renamed, set `SERVICE` to that name, for example `SERVICE=familyplanner`.
|
||||
|
||||
For a local CLI restore outside Docker, set the same environment variables used by the app and run:
|
||||
|
||||
```bash
|
||||
|
||||
@@ -767,7 +767,7 @@
|
||||
"backupRestoring": "جارٍ الاستعادة...",
|
||||
"backupRestoredToast": "تمت استعادة قاعدة البيانات. جارٍ إعادة التحميل...",
|
||||
"backupCliTitle": "استعادة CLI / Docker Compose",
|
||||
"backupCliHint": "للاستعادة التشغيلية، اربط النسخة داخل الحاوية وشغّل مساعد الاستعادة.",
|
||||
"backupCliHint": "For operational restores, stop the app, mount the backup in a temporary container and replace the database file.",
|
||||
"backupCliBackupHint": "يمكنك أيضًا إنشاء نسخة مباشرة عبر Docker Compose:"
|
||||
},
|
||||
"login": {
|
||||
|
||||
@@ -792,7 +792,7 @@
|
||||
"backupRestoring": "Wird wiederhergestellt...",
|
||||
"backupRestoredToast": "Datenbank wiederhergestellt. Seite wird neu geladen...",
|
||||
"backupCliTitle": "CLI / Docker-Compose-Wiederherstellung",
|
||||
"backupCliHint": "Kopiere für operative Wiederherstellungen das Backup in den Container und starte den Restore-Helfer.",
|
||||
"backupCliHint": "Für operative Wiederherstellungen die App stoppen, das Backup in einen temporären Container einbinden und die Datenbankdatei ersetzen.",
|
||||
"backupCliBackupHint": "Du kannst auch direkt über Docker Compose ein Backup erstellen:"
|
||||
},
|
||||
"login": {
|
||||
|
||||
@@ -767,7 +767,7 @@
|
||||
"backupRestoring": "Γίνεται επαναφορά...",
|
||||
"backupRestoredToast": "Η βάση επαναφέρθηκε. Επαναφόρτωση...",
|
||||
"backupCliTitle": "Επαναφορά CLI / Docker Compose",
|
||||
"backupCliHint": "Για λειτουργική επαναφορά, προσαρτήστε το αντίγραφο στο container και εκτελέστε τον βοηθό.",
|
||||
"backupCliHint": "For operational restores, stop the app, mount the backup in a temporary container and replace the database file.",
|
||||
"backupCliBackupHint": "Μπορείτε επίσης να δημιουργήσετε αντίγραφο απευθείας με Docker Compose:"
|
||||
},
|
||||
"login": {
|
||||
|
||||
@@ -767,7 +767,7 @@
|
||||
"backupRestoring": "Restoring...",
|
||||
"backupRestoredToast": "Database restored. Reloading...",
|
||||
"backupCliTitle": "CLI / Docker Compose restore",
|
||||
"backupCliHint": "For operational restores, copy the backup into the container and run the restore helper.",
|
||||
"backupCliHint": "For operational restores, stop the app, mount the backup in a temporary container and replace the database file.",
|
||||
"backupCliBackupHint": "You can also create a backup directly from Docker Compose:"
|
||||
},
|
||||
"login": {
|
||||
|
||||
@@ -767,7 +767,7 @@
|
||||
"backupRestoring": "Restaurando...",
|
||||
"backupRestoredToast": "Base de datos restaurada. Recargando...",
|
||||
"backupCliTitle": "Restauración por CLI / Docker Compose",
|
||||
"backupCliHint": "Para restauraciones operativas, monta la copia en el contenedor y ejecuta el asistente de restauración.",
|
||||
"backupCliHint": "For operational restores, stop the app, mount the backup in a temporary container and replace the database file.",
|
||||
"backupCliBackupHint": "También puedes crear una copia directamente con Docker Compose:"
|
||||
},
|
||||
"login": {
|
||||
|
||||
@@ -767,7 +767,7 @@
|
||||
"backupRestoring": "Restauration...",
|
||||
"backupRestoredToast": "Base restaurée. Rechargement...",
|
||||
"backupCliTitle": "Restauration CLI / Docker Compose",
|
||||
"backupCliHint": "Pour une restauration opérationnelle, monte la sauvegarde dans le conteneur et lance l’assistant.",
|
||||
"backupCliHint": "For operational restores, stop the app, mount the backup in a temporary container and replace the database file.",
|
||||
"backupCliBackupHint": "Tu peux aussi créer une sauvegarde directement avec Docker Compose :"
|
||||
},
|
||||
"login": {
|
||||
|
||||
@@ -767,7 +767,7 @@
|
||||
"backupRestoring": "पुनर्स्थापित हो रहा है...",
|
||||
"backupRestoredToast": "डेटाबेस पुनर्स्थापित हुआ। फिर से लोड हो रहा है...",
|
||||
"backupCliTitle": "CLI / Docker Compose पुनर्स्थापना",
|
||||
"backupCliHint": "ऑपरेशनल पुनर्स्थापना के लिए, बैकअप को कंटेनर में माउंट करें और restore helper चलाएँ।",
|
||||
"backupCliHint": "For operational restores, stop the app, mount the backup in a temporary container and replace the database file.",
|
||||
"backupCliBackupHint": "आप Docker Compose से सीधे बैकअप भी बना सकते हैं:"
|
||||
},
|
||||
"login": {
|
||||
|
||||
@@ -767,7 +767,7 @@
|
||||
"backupRestoring": "Ripristino...",
|
||||
"backupRestoredToast": "Database ripristinato. Ricaricamento...",
|
||||
"backupCliTitle": "Ripristino CLI / Docker Compose",
|
||||
"backupCliHint": "Per ripristini operativi, monta il backup nel container ed esegui l’helper.",
|
||||
"backupCliHint": "For operational restores, stop the app, mount the backup in a temporary container and replace the database file.",
|
||||
"backupCliBackupHint": "Puoi anche creare un backup direttamente con Docker Compose:"
|
||||
},
|
||||
"login": {
|
||||
|
||||
@@ -767,7 +767,7 @@
|
||||
"backupRestoring": "復元中...",
|
||||
"backupRestoredToast": "データベースを復元しました。再読み込み中...",
|
||||
"backupCliTitle": "CLI / Docker Compose 復元",
|
||||
"backupCliHint": "運用復元では、バックアップをコンテナにマウントして復元ヘルパーを実行します。",
|
||||
"backupCliHint": "For operational restores, stop the app, mount the backup in a temporary container and replace the database file.",
|
||||
"backupCliBackupHint": "Docker Compose から直接バックアップを作成することもできます:"
|
||||
},
|
||||
"login": {
|
||||
|
||||
@@ -767,7 +767,7 @@
|
||||
"backupRestoring": "Restaurando...",
|
||||
"backupRestoredToast": "Banco de dados restaurado. Recarregando...",
|
||||
"backupCliTitle": "Restauração via CLI / Docker Compose",
|
||||
"backupCliHint": "Para restaurações operacionais, copie o backup para o container e execute o helper de restauração.",
|
||||
"backupCliHint": "Para restaurações operacionais, pare a aplicação, monte o backup em um container temporário e substitua o arquivo do banco de dados.",
|
||||
"backupCliBackupHint": "Você também pode criar um backup diretamente pelo Docker Compose:"
|
||||
},
|
||||
"login": {
|
||||
|
||||
@@ -767,7 +767,7 @@
|
||||
"backupRestoring": "Восстановление...",
|
||||
"backupRestoredToast": "База данных восстановлена. Перезагрузка...",
|
||||
"backupCliTitle": "Восстановление CLI / Docker Compose",
|
||||
"backupCliHint": "Для операционного восстановления подключите копию к контейнеру и запустите помощник восстановления.",
|
||||
"backupCliHint": "For operational restores, stop the app, mount the backup in a temporary container and replace the database file.",
|
||||
"backupCliBackupHint": "Также можно создать копию напрямую через Docker Compose:"
|
||||
},
|
||||
"login": {
|
||||
|
||||
@@ -767,7 +767,7 @@
|
||||
"backupRestoring": "Återställer...",
|
||||
"backupRestoredToast": "Databasen återställd. Laddar om...",
|
||||
"backupCliTitle": "CLI / Docker Compose-återställning",
|
||||
"backupCliHint": "För driftåterställning, montera backupen i containern och kör återställningshjälpen.",
|
||||
"backupCliHint": "For operational restores, stop the app, mount the backup in a temporary container and replace the database file.",
|
||||
"backupCliBackupHint": "Du kan också skapa en backup direkt med Docker Compose:"
|
||||
},
|
||||
"login": {
|
||||
|
||||
@@ -767,7 +767,7 @@
|
||||
"backupRestoring": "Geri yükleniyor...",
|
||||
"backupRestoredToast": "Veritabanı geri yüklendi. Yeniden yükleniyor...",
|
||||
"backupCliTitle": "CLI / Docker Compose geri yükleme",
|
||||
"backupCliHint": "Operasyonel geri yüklemeler için yedeği konteynere bağlayın ve geri yükleme yardımcısını çalıştırın.",
|
||||
"backupCliHint": "For operational restores, stop the app, mount the backup in a temporary container and replace the database file.",
|
||||
"backupCliBackupHint": "Docker Compose ile doğrudan yedek de oluşturabilirsiniz:"
|
||||
},
|
||||
"login": {
|
||||
|
||||
@@ -767,7 +767,7 @@
|
||||
"backupRestoring": "Відновлення...",
|
||||
"backupRestoredToast": "Базу даних відновлено. Перезавантаження...",
|
||||
"backupCliTitle": "Відновлення CLI / Docker Compose",
|
||||
"backupCliHint": "Для операційного відновлення підключіть копію до контейнера та запустіть помічник.",
|
||||
"backupCliHint": "For operational restores, stop the app, mount the backup in a temporary container and replace the database file.",
|
||||
"backupCliBackupHint": "Також можна створити копію безпосередньо через Docker Compose:"
|
||||
},
|
||||
"login": {
|
||||
|
||||
@@ -767,7 +767,7 @@
|
||||
"backupRestoring": "正在恢复...",
|
||||
"backupRestoredToast": "数据库已恢复。正在重新加载...",
|
||||
"backupCliTitle": "CLI / Docker Compose 恢复",
|
||||
"backupCliHint": "对于运维恢复,请将备份挂载到容器并运行恢复助手。",
|
||||
"backupCliHint": "For operational restores, stop the app, mount the backup in a temporary container and replace the database file.",
|
||||
"backupCliBackupHint": "也可以直接通过 Docker Compose 创建备份:"
|
||||
},
|
||||
"login": {
|
||||
|
||||
@@ -760,9 +760,11 @@ export async function render(container, { user }) {
|
||||
<div class="settings-card">
|
||||
<h3 class="settings-card__title">${t('settings.backupCliTitle')}</h3>
|
||||
<p class="form-hint">${t('settings.backupCliHint')}</p>
|
||||
<pre class="settings-code-block"><code>docker compose stop oikos
|
||||
docker compose run --rm -v "$PWD/oikos-backup.db:/tmp/oikos-restore.db:ro" oikos node scripts/restore-backup.js /tmp/oikos-restore.db
|
||||
docker compose up -d</code></pre>
|
||||
<pre class="settings-code-block"><code>SERVICE=oikos
|
||||
BACKUP="$PWD/oikos-backup.db"
|
||||
docker compose stop "$SERVICE"
|
||||
docker compose run --rm -v "$BACKUP:/tmp/oikos-restore.db:ro" --entrypoint sh "$SERVICE" -c 'set -eu; target="\${DB_PATH:-/data/oikos.db}"; stamp=$(date -u +%Y%m%dT%H%M%SZ); if [ -f "$target" ]; then cp "$target" "$target.pre-restore-$stamp"; fi; rm -f "$target-wal" "$target-shm"; cp /tmp/oikos-restore.db "$target"; chown node:node "$target" 2>/dev/null || true'
|
||||
docker compose up -d "$SERVICE"</code></pre>
|
||||
<p class="form-hint">${t('settings.backupCliBackupHint')}</p>
|
||||
<pre class="settings-code-block"><code>docker compose exec oikos node -e "import('./server/db.js').then(async db => { await db.backupToFile('/data/oikos-backup.db'); process.exit(0); })"
|
||||
docker cp oikos:/data/oikos-backup.db ./oikos-backup.db</code></pre>
|
||||
|
||||
+4
-4
@@ -13,10 +13,10 @@
|
||||
* → bypassCacheUntil (in-memory + Cache API für SW-Restart-Robustheit)
|
||||
*/
|
||||
|
||||
const SHELL_CACHE = 'oikos-shell-v71';
|
||||
const PAGES_CACHE = 'oikos-pages-v66';
|
||||
const LOCALES_CACHE = 'oikos-locales-v15';
|
||||
const ASSETS_CACHE = 'oikos-assets-v66';
|
||||
const SHELL_CACHE = 'oikos-shell-v72';
|
||||
const PAGES_CACHE = 'oikos-pages-v67';
|
||||
const LOCALES_CACHE = 'oikos-locales-v16';
|
||||
const ASSETS_CACHE = 'oikos-assets-v67';
|
||||
const BYPASS_CACHE = 'oikos-bypass-flag';
|
||||
const ALL_CACHES = [SHELL_CACHE, PAGES_CACHE, LOCALES_CACHE, ASSETS_CACHE];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user