diff --git a/docs/8.0/ayanova/docs/ops-restore.md b/docs/8.0/ayanova/docs/ops-restore.md index 3228145b..94293149 100644 --- a/docs/8.0/ayanova/docs/ops-restore.md +++ b/docs/8.0/ayanova/docs/ops-restore.md @@ -139,6 +139,16 @@ pg_restore -U postgres -c -d AyaNova ~/downloads/db-20211212195504569.backup The restore will complete normally without any message if successful. +#### If AyaNova connects to PostgreSQL with its own user + +The examples above are for the default setup, where AyaNova connects to PostgreSQL as the `postgres` user (the `Username` in [AYANOVA_DB_CONNECTION](ops-config-db.md)). If you have set AyaNova up to connect as a different, dedicated PostgreSQL user, the restored tables must belong to that user: add `--no-owner --no-privileges --role=` followed by that user name to the restore command. For example, for a PostgreSQL user named `ayanova`: + +```bash +pg_restore -U postgres -c --no-owner --no-privileges --role=ayanova -d AyaNova ~/downloads/db-20211212195504569.backup +``` + +Without these options the restored tables belong to `postgres` and AyaNova will refuse to start with a database integrity error. + ### Linux server only - set ownershipt and permissions Before restarting the AyaNova server on Linux it will first be necessary to reset the ownership and permissions for the files and folders or AyaNova will not be able to write it's log, access attachments or generate reports properly.