Backup and Restore for GitFlic Running with Docker Compose
Backup Procedure
To maintain data consistency, it's recommended to stop the GitFlic service before backup.
-
Run
docker volume lsto identify volumes containing GitFlic data:docker volume ls -q | grep -e gitflic_data -e gitflic_cert -e pg_data -e redis_data -e gitflic_etc# Sample output: docker_gitflic_data docker_gitflic_etc docker_pg_data docker_redis_data gitflic_certgitflic_datavolume stores GitFlic application datagitflic_etcvolume stores GitFlic configurationgitflic_certvolume stores certificatespg_datavolume stores PostgreSQL databaseredis_datavolume stores Redis database
-
Execute backup commands (replace volume names with your actual values):
PG_VOL=docker_pg_data REDIS_VOL=docker_redis_data GF_VOL=docker_gitflic_data GF_ETC_VOL=docker_gitflic_etc GF_CERT_VOL=gitflic_cert docker run --rm -v ${PG_VOL}:/pg_data -v ./backups:/backups alpine tar -cvf /backups/pg_data.tar -C /pg_data . docker run --rm -v ${REDIS_VOL}:/redis_data -v ./backups:/backups alpine tar -cvf /backups/redis_data.tar -C /redis_data . docker run --rm -v ${GF_VOL}:/gitflic_data -v ./backups:/backups alpine tar -cvf /backups/gitflic_data.tar -C /gitflic_data . docker run --rm -v ${GF_ETC_VOL}:/gitflic_etc -v ./backups:/backups alpine tar -cvf /backups/gitflic_etc.tar -C /gitflic_etc . docker run --rm -v ${GF_CERT_VOL}:/gitflic_cert -v ./backups:/backups alpine tar -cvf /backups/gitflic_cert.tar -C /gitflic_cert . -
A
backupsdirectory will be created containing GitFlic data archives. Store these files in your storage system for future recovery.
Restore Procedure
-
Stop the GitFlic service
-
Identify volumes (same as backup procedure):
docker volume ls -q | grep -e gitflic_data -e gitflic_cert -e pg_data -e redis_data -e gitflic_etc -
Navigate to the directory containing your backup archives
-
Execute restore commands (replace volume names with your actual values):
PG_VOL=docker_pg_data REDIS_VOL=docker_redis_data GF_VOL=docker_gitflic_data GF_ETC_VOL=docker_gitflic_etc GF_CERT_VOL=gitflic_cert docker run --rm -v ${PG_VOL}:/pg_data -v ./backups:/backups alpine tar -xvf /backups/pg_data.tar -C /pg_data . docker run --rm -v ${REDIS_VOL}:/redis_data -v ./backups:/backups alpine tar -xvf /backups/redis_data.tar -C /redis_data . docker run --rm -v ${GF_VOL}:/gitflic_data -v ./backups:/backups alpine tar -xvf /backups/gitflic_data.tar -C /gitflic_data . docker run --rm -v ${GF_ETC_VOL}:/gitflic_etc -v ./backups:/backups alpine tar -xvf /backups/gitflic_etc.tar -C /gitflic_etc . docker run --rm -v ${GF_CERT_VOL}:/gitflic_cert -v ./backups:/backups alpine tar -xvf /backups/gitflic_cert.tar -C /gitflic_cert . -
Data will be restored from the backup archives
-
Start GitFlic and verify data integrity
Automatic Translation!
This page has been translated using automated tools. The text may contain inaccuracies.