mirror of
https://framagit.org/les/gancio.git
synced 2025-01-31 16:42:22 +01:00
1.2 KiB
1.2 KiB
layout | title | permalink | nav_order | parent |
---|---|---|---|---|
default | Backup | /install/backup | 5 | Install |
Backup
The following commands should be valid for every setup (docker/debian/sqlite/postgres).
- Move to gancio path
cd /opt/gancio/ # or where your installation is
- Backup PostgreSQL (only required for non-docker PostgreSQL installation)
sudo -u postgres pg_dump -Fc gancio > gancio.dump
- Archive database, configuration, custom user locales, logs, images and thumbnails
sudo tar -czf gancio-$(date +%Y-%m-%d-%H%M%S)-backup.tgz \
$(ls -d config.json uploads user_locale db.sqlite gancio.dump postgres data db logs 2> /dev/null)
info "Automatic backup" To periodically backup your data you should probably use something like restic or borg
Restore
- Install a clean gancio
- Move to gancio path
cd /opt/gancio/ # or where your installation is
- Extract your backup
tar xvf gancio-*-backup.tgz
- Restore PostgreSQL database (only required for non-docker PostgreSQL installation)
sudo -u postgres createdb gancio
sudo -u postgres pg_restore -d gancio gancio.dump