2.6 KiB
2.6 KiB
Setup
Install
Requirements
- Docker Currently hosted on an ubuntu lxc container with docker and portainer + information.
- On instructions replace githost with host ip or address
Services (Stacks)
If portainer installed use portainer (http://githost:9000) to setup/manage services Stacks:
- Stack Name: gitea Docker Compose
Access duplicati (http://ipaddress:8200) and set a password
Restore
Requirements
- Host setup with docker and portainer + information
Process
- Recreate stack gitea Docker Compose removing read only restrictions on duplicati volumes
- Check Every Container is ok and running
- Stop Every Container except duplicati (including portainer, if restoring portainer is a requirement) note: restore portainer not tested
- Enter Duplicati (http://githost:8200)
- Import Backup job (if not possible next steps must be adapted)
- All Imported jobs schedules must be disabled (or disable write permissions on backup host)
- Remove references to scripts (example:run-script-before-required)
- Recreate duplicati local database (home-> backup-> advanced-> database-> Recreate (delete and repair))
- Restore all files to original location
- If database engine is diferent do not restore db_data and check restore database before next steps
- Restore to duplicati only custom scripts (duplicati-data/myScripts), dot not restore full duplicati with this processs because duplicati is running!
- Recreate stack gitea Docker Compose with original read only restrictions on duplicati volumes
Database
Only required of database data files not recovarable (example: diferent database engine from backup)
- Start Portainer container (if stopped in restore process)
- Start Database container (if stopped in restore process)
- Enter dabase container bash (by using portainer)
- Execute Command
```bash
#check last files db-dumps
ls /git/db-dumps
#pick file to import (maybe the last one :))
```
import file
```bash
ls /db-dumps
#select a file to import
DB_FILE=filenametoimport
# by default duplicati container dont have de enviroment varible ${DB_ROOT_PASSWORD}
mysql -uroot -p'${MYSQL_ROOT_PASSWORD}' $MYSQL_DATABASE < /db-dumps/$DB_FILE
mysql -uroot -p $MYSQL_DATABASE < /db-dumps/$DB_FILE
and enter rootpassword
mysql --host db -uroot -p'${MYSQL_ROOT_PASSWORD}' < /git/db-dumps/$DB_FILE
```
- start all stop containers and check everyting is ok
- Execute backup on duplicati
- Check backup is restorable
- Re Enable schedule backups on duplication