Files
git.limbosolutions.com/documentation/setup.md
2022-10-08 16:56:26 +01:00

2.4 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:

Access duplicati (http://ipaddress:8200) and set a password

Restore

Requirements

Process

  1. Recreate stack gitea Docker Compose removing read only restrictions on duplicati volumes
  2. Check every Container is ok and running
  3. Stop every Container except duplicati and portainer note: restore of portainer/duplicati not tested
  4. Enter Duplicati (http://githost:8200)
  5. Import Backup job (if not possible next steps must be adapted)
    • Restore with permissions checked
    • All Imported jobs schedules must be disabled (or disable write permissions on backup host)
    • Remove references to scripts (example:run-script-before-required, /data/myScripts/backupdb.sh)
  6. Recreate duplicati local database (home-> backup-> advanced-> database-> Recreate (delete and repair))
  7. Restore all files to original location
    • If database engine is diferent do not restore db_data and check restore database before next steps
    • From duplicati only restore custom scripts (duplicati-data/myScripts), dot not restore full duplicati with this processs because duplicati is running!
  8. Recreate stack gitea Docker Compose with original read only restrictions on duplicati volumes
  9. Confirm everything is ok and running
  10. Return to duplicati on schedule job add script to run-script-before-required /data/myScripts/backupdb.sh
  11. Execute a backup
  12. Reenable Scheduling

Database

Only required if database data files not recovarable. (Example: diferent database engine from backup)

  1. Start Portainer container (if stopped in restore process)
  2. Start Database container (if stopped in restore process)
  3. Enter Database container bash (by using portainer)
  4. Execute:
#select a file to import
ls /db-dumps
#select a file to import
DB_FILE= "file name to import"
# 
mysql --host db -uroot -p ${MYSQL_DATABASE} < /db-dumps/$DB_FILE
#enter root password (root password is in enviromnent variable ${MYSQL_ROOT_PASSWORD})