From d6ef493faeb52d305b5e1bbd86c5251818423809 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Tue, 24 Jan 2023 15:40:08 +0100 Subject: [PATCH] Created Backup & Restore Data (markdown) --- Backup-&-Restore-Data.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 Backup-&-Restore-Data.md diff --git a/Backup-&-Restore-Data.md b/Backup-&-Restore-Data.md new file mode 100644 index 0000000..19c7fe6 --- /dev/null +++ b/Backup-&-Restore-Data.md @@ -0,0 +1,21 @@ +# Backup and Restore Data + +When working productively you should backup the data and configuration of Part-DB regularly to prevent data loss. This is also useful, if you want to migrate your Part-DB instance from one server to another. In that case you just have to backup the data on server 1, move the backup to server 2, install Part-DB on server 2 and restore the backup. + +## Backup +There are 3 parts which have to be backup-ed: The configuration files, which contains the instance specific options, the uploaded files of attachments, and the database containing the most data of Part-DB. +Everything else like thumbnails and cache files, are recreated automatically when needed. + +### Configuration files +You have to copy the `.env.local` file and (if you have changed it) the `config/parameters.yaml` and `config/banner.md` to your backup location. + +### Attachment files +You have to recursively copy the `uploads/` folder and the `public/media` folder to your backup location. + +### Database +#### Sqlite +If you are using sqlite, it is sufficient to just copy your `app.db` from your database location (normally `var/app.db`) to your backup location. + +#### MySQL / MariaDB +For MySQL / MariaDB you have to dump the database to an SQL file. You can do this manually with phpmyadmin, or you use [`mysqldump`](https://mariadb.com/kb/en/mariadb-dumpmysqldump/) to dump the database to an SQL file via command line interface (`mysqldump -uBACKUP -pPASSWORD DATABASE`) +