Upgrading the orchestrator#
Upgrading by migrating from one orchestrator to another orchestrator#
This document describes how to upgrade to a new version of the orchestrator by setting up a new orchestrator next to the existing orchestrator and migrating all the state from the existing to the new orchestrator. This procedure should be followed when an in-place upgrade of the orchestrator is not possible e.g. when the operating system needs to be upgraded alongside the orchestrator.
Terminology#
The procedure below describes how to migrate from one running orchestrator denoted as the ‘old orchestrator’ to another one denoted as the ‘new orchestrator’.
Procedure#
Note
Pre-requisite
Before upgrading the orchestrator to a new major version, make sure the old orchestrator is at the latest version available within its major.
Upgrades should be done one major version at a time. Upgrading from major version
X
to major versionX+2
, should be done by upgrading fromX
toX+1
and then fromX+1
toX+2
.
1. [New Orchestrator]: Make sure the desired version of the orchestrator is installed, by following the installation instructions (see Install Inmanta) and set up a project to validate that the orchestrator is configured correctly (config, credentials, access to packages, etc.).
[Old Orchestrator] Halt all environments (by pressing the
STOP
button in the web-console for each environment).[Old Orchestrator] Stop the server:
sudo systemctl disable --now inmanta-server.service
[Old Orchestrator] Make a dump of the server database using
pg_dump
.
pg_dump -U <db_user> -W -h <host> <db_name> > <db_dump_file>
[New Orchestrator] Make sure the server is stopped:
sudo systemctl stop inmanta-server.service
[New Orchestrator] Drop the inmanta database and recreate it:
# drop the database
$ psql -h <host> -U <db_user> -W
drop database <db_name>;
exit
# re-create it
$ sudo -u postgres -i bash -c "createdb -O <db_user> <db_name>"
[New Orchestrator] Load the dump of the server database using
psql
.
cat <db_dump_file> | psql -U <db_user> -W -h <host> <db_name>
[New Orchestrator] Start the orchestrator service, it might take some time before the orchestrator goes up, as some database migration will be done:
sudo systemctl enable --now inmanta-server.service
[New Orchestrator] When accessing the web console, all the environments will be visible, and still halted.
[New Orchestrator] One environment at a time:
a. In the Desired State page of the environment, click
Update project & recompile
, accessible via the dropdown of theRecompile
button. (/console/desiredstate?env=<your-env-id>
).Resume the environment by pressing the green
Resume
button in the bottom left corner of the console.
Warning
Make sure the compilation has finished and was successful before moving on to the next steps.