2023-01-10 14:46:08 +00:00
|
|
|
# lor.sh
|
|
|
|
|
|
|
|
## Installation notes
|
|
|
|
|
2023-02-19 12:01:51 +00:00
|
|
|
0. Use the unstable channel.
|
|
|
|
|
2023-01-10 14:46:08 +00:00
|
|
|
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
|
2023-07-31 21:05:16 +00:00
|
|
|
sudo -u mastodon mastodon-tootctl feeds build
|
2023-01-10 14:46:08 +00:00
|
|
|
```
|