From 8628a12ec58188b60345f961575765251fdabd6f Mon Sep 17 00:00:00 2001 From: "marcio.fernandes" Date: Sat, 1 Oct 2022 16:31:22 +0100 Subject: [PATCH 01/10] Add 'documentation/restore.md' --- documentation/restore.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 documentation/restore.md diff --git a/documentation/restore.md b/documentation/restore.md new file mode 100644 index 0000000..32bae66 --- /dev/null +++ b/documentation/restore.md @@ -0,0 +1,23 @@ +# restore +1) Setup +2) stop all containers + +### restore storate +1) enter duplicati import backup job +2) restore for original folders (including db-d) +Atention only restore db storage files if db engine is de same + +### restore database +1) confirm if DB container is running +2) enter on duplicati container bash + +execute: + +```bash +mysql -uroot -p'${DB_ROOT_PASSWORD}' ${DB_NAME} < /git/db-dumps/filelename.sql +``` +3) start git aplication and check everyting is ok + + + + From 10f7cf88d2260e5ca876d3da367823fa949e1ba1 Mon Sep 17 00:00:00 2001 From: "marcio.fernandes" Date: Sat, 1 Oct 2022 16:37:11 +0100 Subject: [PATCH 02/10] Update 'documentation/restore.md' --- documentation/restore.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/documentation/restore.md b/documentation/restore.md index 32bae66..2adc92a 100644 --- a/documentation/restore.md +++ b/documentation/restore.md @@ -1,11 +1,16 @@ # restore 1) Setup -2) stop all containers +2) stop all containers except duplicati ### restore storate -1) enter duplicati import backup job -2) restore for original folders (including db-d) -Atention only restore db storage files if db engine is de same +1) Duplicati web UI import backup job + note: disable schedules + +### database engine is the same +2) restore everything to original folders + +### database engine not the same +restore everything except db_data folders (db_dumps must be include in restore\) ### restore database 1) confirm if DB container is running From 0e7c34489c495d82310d40eee10cd1087f262f1e Mon Sep 17 00:00:00 2001 From: "marcio.fernandes" Date: Sat, 1 Oct 2022 16:51:17 +0100 Subject: [PATCH 03/10] Update 'documentation/restore.md' --- documentation/restore.md | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/documentation/restore.md b/documentation/restore.md index 2adc92a..7be99d2 100644 --- a/documentation/restore.md +++ b/documentation/restore.md @@ -1,28 +1,41 @@ # restore -1) Setup -2) stop all containers except duplicati +1) [Setup](./setup.md) +2) Portainer - Stop all containers except duplicati -### restore storate -1) Duplicati web UI import backup job +### Restore Storage + + Duplicati web UI - Import backup job note: disable schedules - ### database engine is the same -2) restore everything to original folders + +Restore everything from backup to original folders ### database engine not the same -restore everything except db_data folders (db_dumps must be include in restore\) -### restore database +Restore everything except db_data folders (db_dumps must be include in restore\) + +#### Restore Database 1) confirm if DB container is running 2) enter on duplicati container bash execute: +```bash +#check last files db-dumps +ls /git/db-dumps +#pick file to import (maybe the last one :)) +``` +import file ```bash -mysql -uroot -p'${DB_ROOT_PASSWORD}' ${DB_NAME} < /git/db-dumps/filelename.sql +DB_FILE=filenametoimport +# by default duplicati container dont have de enviroment varible ${DB_ROOT_PASSWORD} +DB_ROOT_PASSWORD=youdbrootpasswordmysql -uroot -p'${DB_ROOT_PASSWORD}' ${DB_NAME} < /git/db-dumps/$DB_FILE + ``` 3) start git aplication and check everyting is ok - +4) Execute backup on duplicati +5) Check backup is restorable +6) Re Enable schedule backups on duplication From 5513b14587cf50ea047c18c0e6771cc0dfa3984c Mon Sep 17 00:00:00 2001 From: "marcio.fernandes" Date: Sat, 1 Oct 2022 16:52:16 +0100 Subject: [PATCH 04/10] Update 'documentation/restore.md' --- documentation/restore.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/documentation/restore.md b/documentation/restore.md index 7be99d2..210da98 100644 --- a/documentation/restore.md +++ b/documentation/restore.md @@ -29,9 +29,10 @@ import file ```bash DB_FILE=filenametoimport # by default duplicati container dont have de enviroment varible ${DB_ROOT_PASSWORD} -DB_ROOT_PASSWORD=youdbrootpasswordmysql -uroot -p'${DB_ROOT_PASSWORD}' ${DB_NAME} < /git/db-dumps/$DB_FILE - +DB_ROOT_PASSWORD=youdbrootpassword +mysql -uroot -p'${DB_ROOT_PASSWORD}' ${DB_NAME} < /git/db-dumps/$DB_FILE ``` + 3) start git aplication and check everyting is ok 4) Execute backup on duplicati 5) Check backup is restorable From 5f28f2ef8aed8b877b9b5e37ec3fafbe4820fad3 Mon Sep 17 00:00:00 2001 From: "marcio.fernandes" Date: Sat, 1 Oct 2022 16:55:06 +0100 Subject: [PATCH 05/10] Update 'documentation/restore.md' --- documentation/restore.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/documentation/restore.md b/documentation/restore.md index 210da98..29af979 100644 --- a/documentation/restore.md +++ b/documentation/restore.md @@ -1,16 +1,19 @@ -# restore -1) [Setup](./setup.md) -2) Portainer - Stop all containers except duplicati +# Restore -### Restore Storage +## Prerequisites +- [Setup](./setup.md) +- Portainer - Stop all containers except duplicati + +## Storage Restore Duplicati web UI - Import backup job note: disable schedules -### database engine is the same + +### DB Engine is the same Restore everything from backup to original folders -### database engine not the same +### DB Engine not the same Restore everything except db_data folders (db_dumps must be include in restore\) From 874b2705ce5f4d5c7819d88e0cfec48cd2207a53 Mon Sep 17 00:00:00 2001 From: "marcio.fernandes" Date: Sat, 1 Oct 2022 16:58:58 +0100 Subject: [PATCH 06/10] Update 'documentation/restore.md' --- documentation/restore.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/documentation/restore.md b/documentation/restore.md index 29af979..f1fedc5 100644 --- a/documentation/restore.md +++ b/documentation/restore.md @@ -15,11 +15,11 @@ Restore everything from backup to original folders ### DB Engine not the same -Restore everything except db_data folders (db_dumps must be include in restore\) +Restore everything except db_data folders (db_dumps must be included) #### Restore Database -1) confirm if DB container is running -2) enter on duplicati container bash +- Confirm if DB container is running (only db and duplicati should be running) +- Execute on duplication bash (using portainer) execute: ```bash @@ -36,8 +36,8 @@ DB_ROOT_PASSWORD=youdbrootpassword mysql -uroot -p'${DB_ROOT_PASSWORD}' ${DB_NAME} < /git/db-dumps/$DB_FILE ``` -3) start git aplication and check everyting is ok -4) Execute backup on duplicati +3) start all stop containers and check everyting is ok +4) Execute backup on duplicati 5) Check backup is restorable 6) Re Enable schedule backups on duplication From dbf874fd7fad9ce3e8f14c9caa199698491fb148 Mon Sep 17 00:00:00 2001 From: "marcio.fernandes" Date: Sat, 1 Oct 2022 16:59:33 +0100 Subject: [PATCH 07/10] Update 'documentation/restore.md' --- documentation/restore.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/restore.md b/documentation/restore.md index f1fedc5..361cd9b 100644 --- a/documentation/restore.md +++ b/documentation/restore.md @@ -2,7 +2,7 @@ ## Prerequisites - [Setup](./setup.md) -- Portainer - Stop all containers except duplicati +- Stop all containers except duplicati ## Storage Restore From d45a9c8d035b89fd01a09982ddb194625c8198dc Mon Sep 17 00:00:00 2001 From: "marcio.fernandes" Date: Sat, 1 Oct 2022 17:01:08 +0100 Subject: [PATCH 08/10] Update 'documentation/restore.md' --- documentation/restore.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/restore.md b/documentation/restore.md index 361cd9b..3011916 100644 --- a/documentation/restore.md +++ b/documentation/restore.md @@ -1,7 +1,7 @@ # Restore ## Prerequisites -- [Setup](./setup.md) +- [Setup](setup.md) - Stop all containers except duplicati ## Storage Restore From fffb6ddfa4085f8a457e7882b554308494b590d1 Mon Sep 17 00:00:00 2001 From: "marcio.fernandes" Date: Sat, 1 Oct 2022 17:02:45 +0100 Subject: [PATCH 09/10] Update 'documentation/restore.md' --- documentation/restore.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/documentation/restore.md b/documentation/restore.md index 3011916..db974c5 100644 --- a/documentation/restore.md +++ b/documentation/restore.md @@ -1,5 +1,7 @@ # Restore +[TOC] + ## Prerequisites - [Setup](setup.md) - Stop all containers except duplicati From 9eb54fc4ca42bda621f013c5808943d70d7f290f Mon Sep 17 00:00:00 2001 From: "marcio.fernandes" Date: Sat, 1 Oct 2022 17:11:02 +0100 Subject: [PATCH 10/10] Update 'documentation/setup.md' --- documentation/setup.md | 44 ++++++------------------------------------ 1 file changed, 6 insertions(+), 38 deletions(-) diff --git a/documentation/setup.md b/documentation/setup.md index 7d0914a..6ca76a7 100644 --- a/documentation/setup.md +++ b/documentation/setup.md @@ -1,51 +1,19 @@ # Setup -## Host LXC Container - -``` bash -#set vars -containername=gitsrv01 -``` - -### Create Container - ```bash -lxc launch ubuntu $containername -p enxd0374555c1f8_macvlan && \ -lxc config set $containername "security.nesting" "true" && \ -lxc exec $containername -- bash -c "apt update -y && apt upgrade -y && apt install --yes fuse-overlayfs" && \ -lxc exec $containername -- bash -c "cd ~/ && curl -fsSL https://get.docker.com -o get-docker.sh && sh get-docker.sh" && \ - +git clone https://git.limbosolutions.com/limbosolutions.com/git.limbosolutions.com +cd git.limbosolutions.com +chmod +x /scripts +./scripts/setup-lxc.sh ``` +Setup using portainer [docker compose](docker/docker-compose.yaml). -For more information: -- [LXC/Docker](/kb/lxc/documentation/running-docker.md) -#### Portainer - -##### Create - -```bash -lxc exec $containername -- bash -c "docker run -d -p 8000:8000 -p 9443:9443 --name portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest" && \ -lxc exec $containername -- bash -c "docker container list" -``` - -##### Remove +# Remove ```bash lxc exec $containername -- bash -c "docker rm portainer --force" ``` -For more information: -- [Install Portainer](/kb/portainer/) - -### Remove - -```bash -lxc rm $containername --force -``` - -## Setup Gitea - -Setup using [docker compose](docker/docker-compose.yaml).