GitFlic Backup and Restoration
Important!
- Backup functionality is currently in Beta testing!
- GitFlic CLI operations related to backup and restoration may contain bugs!
- Please report any issues or suggestions to support@gitflic.ru
Overview
Starting from version 4.0.0, GitFlic CLI provides capabilities for creating and restoring backups of your GitFlic installation.
Prerequisites
Before using GitFlic CLI, ensure:
1. The GitFlic instance is running and operational
2. GitFlic CLI is executed by a user with read/write permissions to:
- GitFlic static directories (/var/gitflic/)
- GitFlic databases  
3. The server has pre-installed pg_dump and pg_restore utilities (typically installed with PostgreSQL)  
Verify utility availability with:
which pg_dump  
which pg_restore  
4. Add the following parameter to GitFlic's configuration file (application.properties):
gitflic.backup.pg_util-path=/usr/bin  
Launching GitFlic CLI
1. Extract GitFlic software archive:
unzip gitflic_4.0.0_free_onpremise.zip  
2. Navigate to the cli directory:
cd /path/to/archive/cli  
3. Make the script executable:
chmod +x ./gitflic-cli.sh  
4. Launch GitFlic CLI with your configuration file:
./gitflic-cli.sh /path/to/application.properties  
Service Mode
The system automatically enters service mode during backup/restore operations. Manual control is available:
Enable Service Mode
service mode start  
- Stops all active connections
- Disables HTTP(S) requests
- Disables SSH access
- Stops message handlers
- Skips scheduled tasks
Expected log output:
Service mode activated  
Disable Service Mode
service mode stop  
Service mode deactivated  
Creating Backups
Create backup with:
backup  
backup /backup/path/  
Note!
- Ensure write permissions for target directory
- For security, RSA/SSH keys and application.propertiesare excluded
Sample output:
Service mode activation  
Service mode activated  
Backup process started  
___________________________________  
Backup results  
___________________________________  
|rsa_public_key |NOT_FOUND_SKIPPED|  
|rsa_private_key|NOT_FOUND_SKIPPED|  
|audit          |NOT_FOUND_SKIPPED|  
|releases       |SUCCESS          |  
|images         |SUCCESS          |  
|cicd           |SUCCESS          |  
|registry       |SUCCESS          |  
|repository     |SUCCESS          |  
|ssh_cert       |SUCCESS          |  
|database       |SUCCESS          |  
___________________________________  
Service mode deactivated  
Restoring from Backup
Restore with:
restore /path/to/backup.tar.gz  
Warning: This will overwrite current GitFlic state!
Sample output:
Service mode activated  
Archive extraction started  
releases : SUCCESS  
images : SUCCESS  
cicd : SUCCESS  
registry : SUCCESS  
repository : SUCCESS  
ssh_cert : SUCCESS  
database : SUCCESS  
Service mode deactivated  
Recommendations
- Perform regular backups
- Store backups on external servers/media
- Verify backup integrity periodically
Automatic translation!
This page has been automatically translated. The text may contain inaccuracies.