docs: add restore procedure (#2071)

This commit is contained in:
Jonas L 2022-08-25 09:50:31 +02:00 committed by GitHub
parent 9001a18f2d
commit 853b0552c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 36 additions and 4 deletions

View File

@ -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.