Since Kiwi TCMS stores all data in the pgsql
database so we will need to backup the whole database.
All backups are stored in ./pgsql-db/backups
directory.
Along with the backup following directories must be manually
backed up.
./kiwitcms-data/uploads
For backup of pgsql database we will need to create a directory and set the correct ownership.
mkdir -p ./pgsql-db/backups
chown -R 1000:1000 ./pgsql-db/backups
Run following command to trigger the backup.
This will create a .sql
file containing database.
docker-compose exec -it pgsql-db /usr/bin/pg_dumpall \
--clean -U postgres > ./pgsql-db/backups/pgsql-db-backup.sql
Followings conditions must be met for restore.
- A working Kiwi TCMS instance.
- Stop the Kiwi TCMS container.
docker-compose down kiwitcms
- Restore/Copy the configuration files.
First remove existing directories.
./kiwitcms-data/uploads
Now copy backed up directories.
Copy uploads to ./kiwitcms-data/uploads
- Copy the postgresql backup file for restore.
Copy pgsql-db-backup.sql file to ./pgsql-db/backups directory.
- Restore the postgresql backup.
docker-compose exec -it pgsql-db psql -U postgres -f /var/lib/postgresql/backups/pgsql-db-backup.sql
docker-compose down
docker-compose up -d
docker-compose logs -f