tenant.env and your data, so keep it as safe as tenant.env itself.
Back up
Back up three things:
Keep
tenant.env in a safe place with the same care as a password. Earnie encrypts the GitHub and GitLab credentials and the single sign-on client secret that it stores in the database. The encryption keys are EARNIE_INTEGRATIONS_KEK_HEX and EARNIE_SSO_KEK_HEX in tenant.env. A restored database is only useful with the same two keys. Without them, Earnie can’t read those stored credentials, and you would have to connect your Git servers and single sign-on again.
Option 1: stop Earnie, then copy everything
This gives a backup in which the database and the data directory agree with each other. Earnie is unavailable while it runs.-
Stop the services:
-
Copy the data directory and
tenant.envto your backup location. For example:If you use your own PostgreSQL server, also take a backup of the database with your usual tool, for examplepg_dump, while Earnie is stopped. -
Start Earnie again:
Option 2: back up while Earnie runs
Usepg_dump for the database. Copy the data directory and tenant.env separately.
For the bundled PostgreSQL:
ONPREM_PG_USER and ONPREM_PG_DB if you changed them from earnie.
For your own PostgreSQL server:
<EARNIE_DATA_DIR>/postgres while Earnie runs, because the copy can be unusable. Exclude it and rely on the pg_dump file:
Test your backup. Restore it on a spare server at least once, so you know the steps work before you need them.
Upgrade
Each release has a version number,vX.Y.Z. To upgrade:
- Back up. Take a full backup first. Database migrations only move forward, and Earnie has no downgrade. See Back up.
- Get the new release. Ask your SCANOSS contact for the new installation bundle. If your server can’t reach the container registry, ask for the new offline image archive too.
-
Use the new bundle. Replace the files in your bundle directory with the files from the new release, but keep your
tenant.env. Compare the newtenant.env.examplewith yourtenant.envand add any new setting you want to change. -
Set the version. In
tenant.env, set the new version: -
Run the installer.
With access to the container registry:
From the offline archive, join the parts, check them, and pass the archive. See From the offline image archive.
Check the upgrade
/healthz must answer with a success status. Then sign in and open a recent project to confirm that your data is there.
Roll back
You can’t downgrade the database. To go back to the previous version, restore the backup you took before the upgrade, then install the previous version.-
Stop the services:
-
Restore your data. Empty the data directory, then extract the backup into it, so no file from after the backup stays behind.
tarstored the paths without the leading/, so extract from/: -
Restore the database.
For the bundled PostgreSQL, you restore the data directory in the previous step, which includes
<EARNIE_DATA_DIR>/postgres. If you took apg_dumpbackup instead, remove<EARNIE_DATA_DIR>/postgres, start only the database, and restore into it:For your own PostgreSQL server, restore into an empty database withpg_restoreor your usual tool. -
Use the bundle of the previous release. Check that
EARNIE_VERSIONin the restoredtenant.envnames that release. -
Run the installer. If the server can’t reach the container registry, pass the previous release’s archive:
With registry access,
./install.shalone is enough.
Restore on a new server
To move Earnie to a new server, or to recover after losing one:- Prepare the new server as in Prepare the host.
- Put the bundle for the version you backed up on the new server.
- Restore
tenant.envand the data directory. Restore the database as in Roll back. - Make sure the DNS name in
EARNIE_HOSTpoints at the new server. If you useEARNIE_TLS=custom, the certificate files are in the data directory unless you setEARNIE_TLS_DIRelsewhere. - Run the installer, with the offline image archive if the server can’t reach the container registry.
What’s next
- Installing Earnie covers configuration and TLS.
- Self-hosting requirements lists the disk space your backups need to cover.