I plan to use the existing MIAB to use for v60 / Ubuntu 22.04.1 LTS, so I hope to have no IP or DNS issues. So the plan is to test the backup on a separate test server first. Once that is successful, I will reset / rebuild the main server to Ubuntu 22.04.1 LTS and re-install MIAB from scratch and backup. I am following the guides as recommended in the v60 announcement. (maintenance / moving box). In a nut shell, the recommendation is to install MIAB first (curl -s https://mailinabox.email/setup.sh | sudo -E bash
), then restore the backup and do sudo mailinabox
to finalise the setup.
So, I am testing the backup on the test server (also Ubuntu 22.04.1 LTS). The last messages from the restore process are:
[...]
Copying duplicity-new-signatures.20221024T184505Z.to.20221025T184505Z.sigtar.gpg to local cache.
Copying duplicity-new-signatures.20221025T184505Z.to.20221026T184504Z.sigtar.gpg to local cache.
Last full backup date: Mon Sep 12 18:42:05 2022
Error '[Errno 17] File exists: b'/home/user-data/ssl/box.abc.com-20230117-af971f04.pem' -> b'/home/user-data/ssl/ssl_certificate.pem'' processing ssl/ssl_certificate.pem
Then, following the instructions in the guide, running sudo mailinabox
I get:
[...]
token frequency: less than 8 occurrences: 13.74%
Installing Nginx (web server)...
FAILED: service nginx restart
-----------------------------------------
Job for nginx.service failed because the control process exited with error code.
See "systemctl status nginx.service" and "journalctl -xeu nginx.service" for details.
-----------------------------------------
systemctl status nginx.service
Γ nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Fri 2022-10-28 00:28:54 UTC; 12min ago
Docs: man:nginx(8)
Process: 54637 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE)
CPU: 32ms
Oct 28 01:28:54 box.abc.com systemd[1]: Starting A high performance web server and a reverse proxy server...
Oct 28 01:28:54 box.abc.com nginx[54637]: nginx: [emerg] SSL_CTX_use_PrivateKey("/home/user-data/ssl/ssl_private_key.pem") f>
Oct 28 01:28:54 box.abc.com nginx[54637]: nginx: configuration file /etc/nginx/nginx.conf test failed
Oct 28 01:28:54 box.abc.com systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
Oct 28 01:28:54 box.abc.com systemd[1]: nginx.service: Failed with result 'exit-code'.
Oct 28 01:28:54 box.abc.com systemd[1]: Failed to start A high performance web server and a reverse proxy server.
lines 1-13/13 (END)
journalctl -xeu nginx.service
ββ Subject: A start job for unit nginx.service has begun execution
ββ Defined-By: systemd
ββ Support: http://www.ubuntu.com/support
ββ
ββ A start job for unit nginx.service has begun execution.
ββ
ββ The job identifier is 8001.
Oct 28 00:28:54 box.abc.com nginx[54637]: nginx: [emerg] SSL_CTX_use_PrivateKey("/home/user-data/ssl/ssl_private_key.pem") f>
Oct 28 00:28:54 box.abc.com nginx[54637]: nginx: configuration file /etc/nginx/nginx.conf test failed
Oct 28 00:28:54 box.abc.com systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
ββ Subject: Unit process exited
ββ Defined-By: systemd
ββ Support: http://www.ubuntu.com/support
ββ
ββ An ExecStartPre= process belonging to unit nginx.service has exited.
ββ
ββ The process' exit code is 'exited' and its exit status is 1.
Oct 28 01:28:54 box.abc.com systemd[1]: nginx.service: Failed with result 'exit-code'.
ββ Subject: Unit failed
ββ Defined-By: systemd
ββ Support: http://www.ubuntu.com/support
ββ
ββ The unit nginx.service has entered the 'failed' state with result 'exit-code'.
Oct 28 01:28:54 box.abc.com systemd[1]: Failed to start A high performance web server and a reverse proxy server.
ββ Subject: A start job for unit nginx.service has failed
ββ Defined-By: systemd
ββ Support: http://www.ubuntu.com/support
ββ
ββ A start job for unit nginx.service has finished with a failure.
ββ
ββ The job identifier is 8001 and the job result is failed.
So it seems to be the initial curl -s https://mailinabox.email/setup.sh | sudo -E bash
installs that PEM file and the restoring process overwrites is, but since it is the old configuration the error appears. Is this correct? How to fix this issue?