Backups¶
It is recommended to make periodic backups and ideally also before major version upgrades.
Backup¶
Database Backup¶
To create a backup of your database you can run the following command
Info
Either the whole compose or at least the db container must be up and running to be able to use exec.
Media Backup¶
To backup the user uploaded media the easiest way is to just make a backup or copy of the volume. In a default configuration the path should be
If that path doesn't exist you can use the inspect command to find the correct one:
Restore¶
Before attempting to restore make sure your database backup is valid. To do so open the sql file and check that it starts with something similar to:
--
-- PostgreSQL database dump
--
-- Dumped from database version 16.11 (Debian 16.11-1.pgdg13+1)
-- Dumped by pg_dump version 16.11 (Debian 16.11-1.pgdg13+1)
Restore Database¶
Stop Containers¶
We only want the db container to run for this step.
Recreate empty database¶
Restore database¶
Restore Media Folder¶
Copy the backup of the media folder to the media volume. Make sure the folder has the correct permissions.