From 990ecbd67ec327e65ee96fed4c6d242491418c61 Mon Sep 17 00:00:00 2001 From: Mikhail Klementev Date: Tue, 10 Jan 2023 14:46:08 +0000 Subject: [PATCH] Installation notes --- README.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..813ba24 --- /dev/null +++ b/README.md @@ -0,0 +1,33 @@ +# lor.sh + +## Installation notes + +1. Prepare the new machine ([man nixos](https://nixos.org/manual/nixos/stable/#sec-installation)) + +``` +git clone https://code.dumpstack.io/infra/lor.sh.git /mnt/etc/nixos +nixos-generate-config --root /mnt +sed -i 's/imports = \[/imports = \[\n.\/disable-services.nix/' /mnt/etc/nixos/configuration.nix +vim /mnt/etc/nixos/secrets.nix +nixos-install --no-root-password +reboot +``` + +2. Change DNS A record + +3. Dump the database on the old machine + +``` +systemctl stop 'mastodon-*' +su - mastodon +pg_dump -Fc mastodon_production -f backup.dump +``` + +4. Load the database and start the server + +``` +sudo -u mastodon pg_restore -Fc -U mastodon -n public --no-owner --role=mastodon -d mastodon backup.dump +sed -i '/disable-services/d' /etc/nixos/configuration.nix +nixos-rebuild switch +su - mastodon -s "$(which bash)" -c 'mastodon-env tootctl feeds build' +```