From d28d81d9ef6960cdc33beeae434333de9071abb6 Mon Sep 17 00:00:00 2001 From: Kaitlyn Parkhurst Date: Sun, 20 Nov 2022 19:28:15 -0800 Subject: [PATCH] Docs --- README.md | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/README.md b/README.md index e1365e1..3b7fbc0 100644 --- a/README.md +++ b/README.md @@ -278,8 +278,59 @@ Now that the `panel_config.jekyll_init_repo` repository exists, we should be rea ### How to perform a system backup +There are two sources of truth for MyJekyllBlog that should be backed up regularly. + +The first is the installation of Gitea, a Git Service, that MyJekyllBlog uses for storage and atomic changes of all Jekyll blogs it hosts. + +The second is the PSQL database for mjb.panel. This database contains all of the information about user accounts, blog ownership, etc. + +#### Backup Gitea Data + +Take a root shell on the store machine and stop gitea. + +```bash +systemctl stop gitea +``` + +Confirm that gitea is stopped by going to the store server over HTTPS. You should recieve a 502 Bad Gateway error. + +```bash +su - git +cd /var/lib/gitea/ +./gitea dump --c /etc/gitea/app.ini +``` + +There will be a file with a timestamp, such as `gitea-dump-1669000424.zip`. This is the backup of all Gitea data and can be used to restore the repositories. + +Remember to start Gitea again. + +```bash +systemctl start gitea +``` + +#### Backup PSQL Data + +Take a shell for the manager user on the store server and run the following. + +```bash +cd mjb/Web +./script/mjb db_dump > psql-backup-`date +%s`.sql +``` + ### How to perform a system restore +#### Restore Gitea Data + +See https://docs.gitea.io/en-us/backup-and-restore/#restore-command-restore for information on processing the gitea-dump-timestamp.zip file. + +#### Restore PSQL Data + +Instructions -- I should make an ansible task that handles this. + +Drop table, create table, import SQL dump. + +TODO + ## Development Guide ### Enable development mode