diff options
| author | 2024-04-30 08:31:13 +0200 | |
|---|---|---|
| committer | 2024-04-30 08:31:13 +0200 | |
| commit | 329fd4bcf6504c74e3906e51c6fc2124bc09cc02 (patch) | |
| tree | 11c6c56d404403eca1996e89aeb6a978b9d92237 /docs/en/admins | |
| parent | 173555795adf6614dff33893b373f22542910675 (diff) | |
CLI database backup and restore (#6387)
* CLI database backup and restore
Can also be used to migrate from one database to another (e.g. MySQL to PostgreSQL) or to ease upgrade to a major PostgreSQL version (e.g. 15 to 16).
* +x
* Fix some cases
* Update to docker-compose-v2
* More documentation
Diffstat (limited to 'docs/en/admins')
| -rw-r--r-- | docs/en/admins/05_Backup.md | 46 | ||||
| -rw-r--r-- | docs/en/admins/Caddy.md | 2 |
2 files changed, 45 insertions, 3 deletions
diff --git a/docs/en/admins/05_Backup.md b/docs/en/admins/05_Backup.md index 061300a37..d724050e1 100644 --- a/docs/en/admins/05_Backup.md +++ b/docs/en/admins/05_Backup.md @@ -10,9 +10,19 @@ Do this before an upgrade. This following tutorial demonstrates commands for backing up FreshRSS. It assumes that your main FreshRSS directory is `/usr/share/FreshRSS`. If you’ve installed it somewhere else, substitute your path as necessary. +### Creating a database backup + +Back-up all users respective database to `data/users/*/backup.sqlite` + +```sh +cd /usr/share/FreshRSS/ +./cli/db-backup.php +``` + ### Creating a Backup of all Files -First, Enter the directory you wish to save your backup to. Here, for example, we’ll save the backup to the user home directory +Enter the directory you wish to save your backup to. +Here, for example, we’ll save the backup to the user home directory ```sh cd ~ @@ -52,7 +62,39 @@ And optionally, as cleanup, remove the copy of your backup from the FreshRSS dir rm FreshRSS-backup.tgz ``` -## Backing up Feeds +### Restore a database backup + +> ℹ️ It is safer to stop your Web server and cron during maintenance operations. + +Restore all users respective database from `data/users/*/backup.sqlite` + +```sh +cd /usr/share/FreshRSS/ +./cli/db-restore.php --delete-backup --force-overwrite +``` + +## Migrate database + +Start by making an automatic backup of the all the user databases to SQLite files: + +```sh +cd /usr/share/FreshRSS/ +./cli/db-backup.php +``` + +Change your database setup: +- if you like to change database type (e.g. from MySQL to PostgreSQL), edit `data/config.php` accordingly. +- if you upgrade to a major PostgreSQL version, after a PostgreSQL backup, you may delete the old instance and start a new instance (remove the PostgreSQL volume if using Docker). + +Restore all the user databases from the SQLite files: + +```sh +./cli/db-restore.php --delete-backup --force-overwrite +``` + +See also our [Docker documentation to migrate database](https://github.com/FreshRSS/FreshRSS/blob/edge/Docker/README.md#migrate-database). + +## Backing up selected content ### Feed list Export diff --git a/docs/en/admins/Caddy.md b/docs/en/admins/Caddy.md index f3c2be96b..9f19113d4 100644 --- a/docs/en/admins/Caddy.md +++ b/docs/en/admins/Caddy.md @@ -49,7 +49,7 @@ To set up FreshRSS behind a reverse proxy with Caddy and using a subfolder, foll Restart FreshRSS to ensure that it recognizes the new base URL: ```bash - docker-compose restart freshrss + docker compose restart freshrss ``` 4. **Access FreshRSS:** |
