Back up and restore data
Back up the database and media, and restore them.
IT teamDone in: Server4 steps
- 1
Back up the database
From
/opt/femnet-lms-drf:docker compose exec postgres pg_dump -U femnet -d femnet > dumps/femnet-$(date +%Y%m%d).sqlSchedule this daily with cron and copy the files off the server.
- 2
Back up media and settings
Copy the media folder (
/opt/femnet-lms-drf/media) and the.envfile. Without the media folder, course pictures and packages are lost. - 3
Restore the database
Stop the app containers:
docker compose stop drf celery_worker celery_beat. Then load the dump:docker compose exec -T postgres psql -U femnet -d femnet < dumps/<file>.sqlRestore into an empty database to avoid conflicts, then start the containers again.
- 4
Test your backups
Every few months, restore a backup onto a test machine and sign in to prove it works.
