From 007b861ad61950fc0db631bab8fdda2de0612e2b Mon Sep 17 00:00:00 2001 From: Hayden <64056131+hay-kot@users.noreply.github.com> Date: Sat, 20 Aug 2022 11:53:48 -0800 Subject: [PATCH] docs: add docs on restoring to PSQL server (#1584) * docs: add docs on restoring to PSQL server * prevent iframe in netlify site --- .../usage/backups-and-restoring.md | 37 +++++++++++++++++++ docs/docs/overrides/api.html | 2 +- docs/mkdocs.yml | 2 + frontend/pages/admin/backups.vue | 8 ++++ netlify.toml | 10 ++++- 5 files changed, 56 insertions(+), 3 deletions(-) create mode 100644 docs/docs/documentation/getting-started/usage/backups-and-restoring.md diff --git a/docs/docs/documentation/getting-started/usage/backups-and-restoring.md b/docs/docs/documentation/getting-started/usage/backups-and-restoring.md new file mode 100644 index 00000000..06e24936 --- /dev/null +++ b/docs/docs/documentation/getting-started/usage/backups-and-restoring.md @@ -0,0 +1,37 @@ +# Backups and Restoring + +Mealie provides an integrated mechanics for doing full installation backups of the database. Naviate to `/admin/backups` to + +- See a list of available backups +- Perform a backups +- Restore a backup + +!!! tip + If you're using Mealie with SQLite all your data is stored in the /app/data/ folder in the container. You can easily perform entire site backups by stopping the container, and backing up this folder with your chosen tool. This is the **best** way to backup your data. + +## Restoring from a Backup + +To restore from a backup it needs to be uploaded to your instance, this can be done through the web portal. On the lower left hand corner of the backups data table you'll see an upload button. Click this button and select the backup file you want to upload and it will be available to import shortly. + +Before importing it's critical that you understand the following: + +- This is a destructive action and will delete all data in the database +- This action cannot be undone +- If this action is successful you will be logged out and you will need to log back in to complete the restore + +!!! warning + Prior to beta-v5 using a mis-matched version of the database backup will result in an error that will prevent you from using the instance of Mealie requiring you to remove all data and reinstall. Post beta-v5 performing a mismatched restore will throw an error and alert the user of the issue. + +### Postgres Note + +Restoring the Database when using Postgres requires Mealie to be configured with a postgres **superuser** account. This is due to our usage of massive deleting of data in the database and temporarily setting roles to perform the restore. To perform a restoration on Postgres you will need to _temporarily_ set the Mealie user to a superuser account. + +```sql +ALTER USER mealie WITH SUPERUSER; + +# Run restore from Mealie + +ALTER USER mealie WITH NOSUPERUSER; +``` + +For more information see [GitHub Issue #1500](https://github.com/hay-kot/mealie/issues/1500) diff --git a/docs/docs/overrides/api.html b/docs/docs/overrides/api.html index 0dfa5492..08165a8f 100644 --- a/docs/docs/overrides/api.html +++ b/docs/docs/overrides/api.html @@ -14,7 +14,7 @@
diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index 1bc0eeab..d0996bcb 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -69,6 +69,8 @@ nav: - PostgreSQL: "documentation/getting-started/installation/postgres.md" - Frontend Configuration: "documentation/getting-started/installation/frontend-config.md" - Backend Configuration: "documentation/getting-started/installation/backend-config.md" + - Usage: + - Backup and Restoring: "documentation/getting-started/usage/backups-and-restoring.md" - Community Guides: - iOS Shortcuts: "documentation/community-guide/ios.md" diff --git a/frontend/pages/admin/backups.vue b/frontend/pages/admin/backups.vue index 06e1ccce..006b6bef 100644 --- a/frontend/pages/admin/backups.vue +++ b/frontend/pages/admin/backups.vue @@ -23,6 +23,14 @@ replace them with the contents of this backup. This action cannot be undone - use with caution. If the restoration is successful, you will be logged out. ++ If you are using PostGreSQL, please review the + backup/restore process in the documentation + prior to restoring. +
+