Add instructions on how to backup and restore the database

This commit is contained in:
Bruno
2024-11-29 13:09:32 +00:00
parent d4b78f4d0e
commit feab00b41c

View File

@@ -23,7 +23,7 @@ Vaults are simply storage containers for your files, and Many Notes provides you
- Light/dark theme (automatically selected by your OS setting)
- Mobile friendly
## Installation guide (Docker)
## Installation (Docker)
Create a new directory called `many-notes`. Inside this directory, create a file named `compose.yaml` and paste the following content:
@@ -116,6 +116,26 @@ Configure an email service to send registration and password reset emails by add
- MAIL_FROM_NAME="Many Notes"
```
## Backup and restore
All your non-note files are saved in the `storage-private` volume, while your notes are stored in the database.
#### Backup database
To back up your database, run:
```shell
docker exec many-notes-mariadb-1 mariadb-dump --all-databases -uroot -p"$MARIADB_ROOT_PASSWORD" > ./backup-many-notes-`date +%Y-%m-%d`.sql
```
#### Restore database
To restore your database from a backup, run:
```shell
docker exec -i many-notes-mariadb-1 sh -c 'exec mariadb -uroot -p"$MARIADB_ROOT_PASSWORD"' < ./$BACKUP_FILE_NAME.sql
```
## License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for the full license text.