From b92d9c889bfa83fac9b2012e111fc8cdcdedd584 Mon Sep 17 00:00:00 2001 From: missytake Date: Tue, 29 Oct 2024 16:42:35 +0100 Subject: [PATCH] doc: use ssh+tar to transfer vmail + dkimkeys as well --- README.md | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 485a7f30..eaf00981 100644 --- a/README.md +++ b/README.md @@ -273,16 +273,21 @@ During the guide, you might get a warning about changed SSH Host keys; in this case, just run `ssh-keygen -R "mail.example.org"` as recommended to make sure you can connect with SSH. -1. First, copy `/var/lib/acme` to your local machine with +1. First, copy `/var/lib/acme` to the new server with `ssh root@13.37.13.37 tar c /var/lib/acme | ssh root@13.12.23.42 tar x -C /var/lib/`. + This transfers your TLS certificate. -2. On the new server, run `chown root: -R /var/lib/acme` to make sure the permissions are correct. +2. You should also copy `/etc/dkimkeys` to the new server with + `ssh root@13.37.13.37 tar c /etc/dkimkeys | ssh root@13.12.23.42 tar x -C /etc/` + so the DKIM DNS record stays correct. -3. Run `cmdeploy run --disable-mail --ssh-host 13.12.23.42` to install chatmail on the new machine. +3. On the new server, run `chown root: -R /var/lib/acme` and `chown root: -R /etc/dkimkeys` to make sure the permissions are correct. + +4. Run `cmdeploy run --disable-mail --ssh-host 13.12.23.42` to install chatmail on the new machine. postfix and dovecot are disabled for now, we will enable them later. -4. Now, point DNS to the new IP addresses. +5. Now, point DNS to the new IP addresses. You can already remove the old IP addresses from DNS. Existing Delta Chat users will still be able to connect @@ -294,31 +299,24 @@ to make sure you can connect with SSH. but normally email servers will retry delivering messages for at least a week, so messages will not be lost. -5. Now you can run `cmdeploy run --disable-mail --ssh-host 13.37.13.37` to disable your old server. +6. Now you can run `cmdeploy run --disable-mail --ssh-host 13.37.13.37` to disable your old server. Now your users will notice the migration and will not be able to send or receive messages until the migration is completed. -6. After everything is stopped, +7. After everything is stopped, you can copy the `/home/vmail/mail` directory to the new server. It includes all user data, messages, password hashes, etc. - If you have enough storage on your local machine, - you can simply download it with `rsync -avz 13.37.13.37:/home/vmail/mail .`, - and upload it again with `rsync -avz mail 13.12.23.42:/home/vmail/`. - - The other way would be copying it - from the old machine to the new machine directly, - which requires setting up an SSH connection - with a new SSH key. + Just run: `ssh root@13.37.13.37 tar c /home/vmail/mail | ssh root@13.12.23.42 tar x -C /home/vmail/` After this, your new server has all the necessary files to start operating :) -7. To be sure the permissions are still fine, +8. To be sure the permissions are still fine, run `chown vmail: -R /home/vmail` on the new server. -8. Finally, you can run `cmdeploy run` to turn on chatmail on the new server. +9. Finally, you can run `cmdeploy run` to turn on chatmail on the new server. Your users can continue using the chatmail server, and messages which were sent after step 6. should arrive now. VoilĂ !