Implement back-ups for wordpress #7
Closed
opened 2020-09-17 18:49:48 +00:00 by decentral1se
·
5 comments
No Branch/Tag Specified
main
kc_stable
kc-stable
backup
anubis
fix/3wc/wp-cli
ftp
ssh
service-rename
drone
3.0.5+7.0.4
3.0.4+7.0.3
3.0.3+7.0.2
3.0.2+7.0.2
3.0.1+7.0.2
2.19.4+6.9.4
2.19.3+6.9.4
3.0.0+7.0.0
2.19.2+6.9.4
2.19.1+6.9.4
2.19.0+6.9.4
2.18.0+6.9.1
2.17.1+6.9.0
2.17.0+6.9.0
2.16.2+6.8.3
2.16.1+6.8.1
2.16.0+6.8.1
2.15.0+6.8.0
2.14.0+6.7.2
2.13.3+6.7.1
2.13.2+6.7.1
2.13.1+6.7.1
2.13.0+6.7.1
2.12.2+6.6.2
2.12.1+6.6.1
2.12.0+6.6.1
2.11.0+6.6.0
2.10.0+6.5.5
2.9.1+6.5.3
2.9.0+6.5.2
2.8.0+6.5.0
2.7.3+6.4.3
2.5.2+6.3.0
2.7.2+6.4.2
2.7.1+6.4.2
2.7.0+6.4.2
2.6.3+6.4.2
2.6.1+6.4.0
2.6.0+6.4.0
2.5.1+6.3.0
2.5.0+6.3.0
2.4.3+6.3.0
2.4.2+6.3.0
2.4.1+6.3.0
2.4.0+6.3.0
2.3.0+6.2.0
2.2.1+6.1.1
2.3.3+6.2.2
2.3.2+6.2.0
2.3.1+6.2.0
2.2.0+6.1.1
2.1.0+6.1.1
2.0.1+6.0.1
2.0.0+6.0.0
1.1.2+5.9.3
1.1.1+5.9.2
1.1.0+5.9.0
1.0.2+5.8.3
1.0.1+5.8.2
1.0.0+5.8.1
Labels
No items
No labels
Milestone
No items
No Milestone
Assignees
3wordchant
aadil (Aadil Ayub)
abra-bot (Abra Bot)
ammaratef45
amras (Sarma)
Apfelwurm
appletalk
arjan
basebuilder
BornDeleuze
Brooke
carla
cas (Cassowary)
codegod100
coopcloud
cyrnel
decentral1se (d1)
dede
devydave
fauno (fauno)
flancian
Frando
iexos
jade (Jade Ambrose)
javielico (Javielico)
jjsfunhouse
jmakdah2 (Jackie Makdah)
joe-irving (Joe Irving)
kawaiipunk (KawaiiPunk)
knoflook
kolaente
lambdabundesverband
linnealovespie (April)
marlon (marlon)
mayel
mirsal
moosemower
moritz
nicksellen (Nick Sellen)
notplants
oxaliq (sorrel)
p4u1
pau
pharaohgraphy (Andrew 🐦🔥❤️🔥✴️)
PhiNatalie
renovate-bot (Comrade Renovate Bot)
ripclap
rix
rscmbbng
sef (sef)
simon
sixsmith (Sixsmith)
stevensting
tobias
trav (Trav Fryer)
val (val (he/him))
vaznasty
virtualboys
wolcen (Chris Thompson)
wykwit
xynosis
yksflip
Clear assignees
No Assignees
decentral1se
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: coop-cloud/wordpress#7
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
We use this thing called swarm-cronjob which "creates jobs on a time-based schedule on Swarm". An example of that being used is our renovate-bot. So, let's use that 🎉 There is a ready baked example for using MariaDB over here which we can work from. It is also looking like we are gonna go with https://docs.borgbase.com for our remote storage/web ui enabled/alert hooks/allow us to sleep at night backup solution.
That's all I know so far, more to come...
One thought is to make a really thin alpine container with mysqldump, borg and borgmatic installed on it. Then mount in the borgmatic config.yml that has the borgbase details in it and then pipe the output of mysqldump into borgmatic so it is shipped off right away. We could install other backup utilities onto that thin image so that it could be a more general solution. This sounds simple enough that it might work 🙏
Ok, I went through the borgbase and borgmatic setup instructions and tried to bake in my ideas above. It seems to be looking workable so far. I've got a new service that is in the compose.yml of this repo: https://git.autonomic.zone/compose-stacks/wordpress/src/branch/master/compose.yml#L47. That relies on really simple image which I've baked over at autonomic-cooperative/backup-bot. The image runs borgmatic which is configured by the borgmatic.yml in this repo.
The only downside I can see right now is that each compose-stack would have to have its own backup service there and it is already some 20 lines and another configuration. We can probably extract this to a separate compose.yml and run it separately like the renovate-bot at some point when we prove to ourselves this is a good way to go. That would just need some wrangling to get the remote connection strings of the database since the service would not be in the same compose.yml definition anymore.
So, backing up the mysql database on crontab is sorted! Using this config: https://git.autonomic.zone/compose-stacks/wordpress/src/branch/master/compose.yml#L47-L71 and this borgmatic config: https://git.autonomic.zone/compose-stacks/wordpress/src/branch/master/borgmatic.yml. Next is to identify which source directories need to be backed up as well.
Which is also a volume. Soooo, perhaps I need to mount the volume from that wp container as a shared volume and then backup directly from the volume in the borgmatic config. Writing this at full speed...something for tomorrow!
OK, mounting the volume in and backing it up over in https://git.autonomic.zone/compose-stacks/wordpress/src/branch/master/borgmatic.yml#L3. I've validated the backups are indeed in there using Vorta to connect to borgbase. I haven't done a restore yet. I'm gonna close this off for now.