Skip to main content

Upgrading

Upgrading Delegaris means running a newer image against the same data. Your accounts, rules, keep-ons and activity log stay in the /data volume (or the PostgreSQL database) and are carried over. A new version updates the database itself when it starts.

Before you upgrade​

  1. Take a backup. Under Settings > Health and backups, choose Back up now. With PostgreSQL, take a snapshot of the database instead. See Backups and health.
  2. Pick a quiet moment. The timed work (stopping machines at the end of a keep-on, reminders) pauses while the container restarts and catches up as soon as it is back, but nobody can use the web interface in between.

Pin the version​

The standard docker-compose.yml runs whatever DELEGARIS_TAG says, and latest when it is not set. In production, pin it in .env so that nothing changes until you decide:

DELEGARIS_TAG=0.9.0

See Docker image tags.

Upgrade a single copy​

  1. Change DELEGARIS_TAG in .env to the new version (or leave it unset to follow latest).

  2. Pull the image and recreate the container:

    docker compose pull
    docker compose up -d
  3. Check it came back on the new version:

    docker compose logs delegaris | grep "starting as"
    curl -s http://127.0.0.1:8080/healthz

    The first shows Delegaris <version> starting as …, and /healthz returns the version with "status": "ok".

If the new version finds a problem with the configuration, the service exits at once and the log lists what is wrong under Configuration problems. Docker keeps starting it again (restart: unless-stopped) until the setting is fixed.

Upgrade the Linux package​

Run the installer again:

curl -fsSL https://github.com/Goodhall-Solutions/delegaris/releases/latest/download/install.sh | sudo bash

Add -s -- --version X.Y.Z after bash for a particular release. The installer backs the database up to /var/lib/delegaris/backups/before-<version>-<time>.db, puts the new version in /opt/delegaris/releases/<version>, points /opt/delegaris/current at it and restarts the service. /etc/delegaris/delegaris.env is never touched.

To go back to the previous version, stop the service, restore the backup the upgrade made, point current back, and start it:

sudo systemctl stop delegaris
ls /opt/delegaris/releases # the versions still there
sudo -u delegaris cp /var/lib/delegaris/backups/before-<new version>-<time>.db /var/lib/delegaris/delegaris.db
sudo rm -f /var/lib/delegaris/delegaris.db-wal /var/lib/delegaris/delegaris.db-shm
sudo ln -sfn releases/<old version> /opt/delegaris/current
sudo systemctl start delegaris

What happens to the database​

When the service starts, it brings the database up to date for its own version: it creates any tables that are new and adds any columns that are new to existing ones. There is no separate migration step to run.

With several copies sharing PostgreSQL, the first copy to start does this while holding a lock, so two copies starting together do not both try.

A /data volume from before the product was called Delegaris keeps its database: the old aws-manager.db file is renamed to delegaris.db on first start.

Going back to an earlier version

Once a newer version has updated the database, the older version may not be able to use it. To go back, change DELEGARIS_TAG to the earlier version and restore the backup you took before upgrading. Anything done since that backup is lost.

Upgrade several copies​

With two or more copies behind a load balancer, upgrade one at a time so the service stays up:

  1. Upgrade the first copy as above and wait until its /healthz answers "status": "ok".
  2. Then upgrade the next.

The timed-work lease moves between copies by itself while this happens. A copy that shuts down cleanly lets go of the lease at once, so another can take over straight away. See High availability.

Keep the copies on the same version except for the minutes in between.

After upgrading​

  • The role in each account. A new version sometimes needs a permission the role in your accounts did not have before; rebooting, for example, needs ec2:RebootInstances and rds:RebootDBInstance, which older copies of the role do not have. Download the template again from the Add an account dialog (the image always carries the current one) and update the stack or StackSet in each account. See Member account role.
  • The service's own role. The same applies to iam/hub-role.yaml, for example the pricing:GetProducts permission used by cost estimates.
  • Test. Test on an account in the Accounts page checks the role still lets the service list everything it manages.