-
Notifications
You must be signed in to change notification settings - Fork 24
upgrade from nginx
This section outlines the migration steps from a previous installation of self-hosted-simplelogin using the NGinx-based setup, to the current Traefik-based setup.
- Backup the database using the following command:
mkdir /tmp/sl-backup/
docker compose \
-f /opt/simplelogin/docker-compose.yaml exec postgres \
pg_dump -U <postgres-user-name> simplelogin -F c -b >/tmp/sl-backup/simplelogin.sql-
Backup your DKIM public and private keys.
-
Backup your PGP keys, avatar picture and undelivered emails from the
upload/andpgp/folders. -
Backup your existing
.envfile.
The postfix container is running a private image that has changed from the previous NGinx-based setup to the current Traefik-based setup.
That image needs to be regenerated. You can remove the previous version using the command:
docker rmi private/postfix:latestIn-place upgrade refers to the fact that you will upgrade the stack from the previous setup to the current setup in the same directoy.
This is the easiest upgrade path as you only need to change the docker-compose and setup files. If you cloned this repository, you most likely need to use git pull to upgrade to the latest version.
Prerequisites: make sure you are running a recent version of SimpleLogin. This section assumes you are running app-ci:v4.70.0.
- Stop the stack using
. ./down.sh. - Upgrade to the latest version of the files.
- Create and update the
.envfile from.env.example.
The new .env file supports specifying parameters for certificate renewal using either the DNS-01 or TLS–ALPN-01 ACME challenge from Let’sEncrypt using LEGO , a Let’sEncrypt client library written in Go. Please, review the LEGO documentation for supported providers and their parameters.
- Start the stack using
. ./up.sh.
You can now cleanup the folders that are no longer useful:
rm -rf acme.sh/
rm -rf nginx/If you want to keep the existing setup in a known working directory, you can use the backup - restore path to test the new setup from a separate folder.
- Clone this repository to get the latest version of the files.
- Create and update the
.envfile from.env.example.
The new .env file supports specifying parameters for certificate renewal using either the DNS-01 or TLS–ALPN-01 ACME challenge from Let’sEncrypt using LEGO , a Let’sEncrypt client library written in Go. Please, review the LEGO documentation for supported providers and their parameters.
- Restore the
pgp/andupload/folders. - Restore the
dkim.pub.keyanddkim.keyfiles. - Restore the postfix
virtualandvirtual-regexpfiles. - Start the stack using
. ./up.sh.
This will create the private/postfix:latest image and request new certificates from Let’s Encrypt.
Once the application is running successfully, you need to restore the database. The easiest way it to copy the backup file in the db/ folder:
sudo cp /tmp/sl-backup/simplelogin.sql db/
docker compose exec -it pg_restore -U <postgres-user-name> \
--dbname=simplelogin \
--clean \
--verbose \
/var/lib/postgresql/data/simplelogin.sql