From 853b0552c982909765690fc6e4edd6c37cb2fbac Mon Sep 17 00:00:00 2001
From: Jonas L <jooola@users.noreply.github.com>
Date: Thu, 25 Aug 2022 09:50:31 +0200
Subject: [PATCH] docs: add restore procedure (#2071)

---
 docs/admin-manual/backup.md | 40 +++++++++++++++++++++++++++++++++----
 1 file changed, 36 insertions(+), 4 deletions(-)

diff --git a/docs/admin-manual/backup.md b/docs/admin-manual/backup.md
index 9d0a619a0..823d60fec 100644
--- a/docs/admin-manual/backup.md
+++ b/docs/admin-manual/backup.md
@@ -33,24 +33,56 @@ Here is an example to dump your PostgreSQL database:
 sudo -u postgres pg_dump --file=libretime.sql libretime
 ```
 
+:::note
+
+Consider using the `--no-owner` and `--no-privileges` flags to ignore roles
+and permissions details about the database. This can be useful when restoring
+to database or role that have different names.
+
+:::
+
 Please read the `pg_dump` usage for additional details.
 
 ### Backup the storage
 
 You need to backup the entire file storage, which holds all the files of your installation.
 
-The path to your storage was defined during the installation process.
+The path to your storage is defined in the [configuration](./setup/configuration.md) file.
 
 ## Restore a backup
 
+### Install or cleanup
+
+If you are restoring a backup on a fresh system, we recommend that you first [install LibreTime](./setup/install.md), and **stop before the [setup tasks](./setup/install.md#setup)**.
+
+If you are restoring a backup on an existing system, make sure to clean the old **database** and **files storage**.
+
 ### Restore the configuration
 
-Copy the backed configuration files back to the configuration folder.
+Copy the backed configuration files back to the [configuration](./setup/configuration.md) folder.
+
+If you are upgrading LibreTime, edit the configuration file to match the new configuration schema and update any changed values. See the [configuration](./setup/configuration.md) documentation for more details.
 
 ### Restore the database
 
-:construction:
+Restore the database by using the following command:
+
+```bash
+sudo -u postgres pg_restore --dbname=libretime libretime.sql
+```
+
+:::note
+
+Consider using the `--no-owner` and `--no-privileges` flags to ignore roles
+and permissions details about the database. This can be useful when restoring
+to database or role that have different names.
+
+:::
+
+If you are upgrading LibreTime, make sure to apply the [database migration](./setup/upgrade.md#apply-migrations).
 
 ### Restore the storage
 
-:construction:
+Copy the entire backed file storage back to the storage path.
+
+The path to your storage is defined in the [configuration](./setup/configuration.md) file.