This guide walks you through migrating an UTMStack V10 installation to V11.
Looking for the Spanish version? See
USER_GUIDE.es.md.
You need:
- A working UTMStack V10 installation
- A Linux server (Ubuntu, Debian, or similar)
sudo/ root access on that server- Internet access (the tool downloads the migration agent from Google Cloud Storage)
You should also know:
- Whether you are upgrading on the same server (in-place) or moving to a new server (two servers)
- The IP and SSH credentials of your V10 server (only required if you run the tool from a separate workstation)
-
Download the binary from the official releases page.
-
Make it executable:
chmod +x utmstack_migration_tool
-
Verify it runs:
./utmstack_migration_tool --help
You should see a list of commands. If you do, the binary is ready.
Most users only need two commands, in this exact order:
# Step 1: Stage the migration agent on every UTMStack agent.
sudo ./utmstack_migration_tool prepare-agents
# Step 2: Upgrade the backend itself.
sudo ./utmstack_migration_tool upgradeRun prepare-agents first, then upgrade. The upgrade command checks that
prepare-agents already ran and refuses to start otherwise. This is on purpose:
it prevents agents from being orphaned in V10 after the backend moves to V11.
Before upgrading the backend, every UTMStack agent must receive the
migrate_agent binary. This command takes care of that and remembers its
progress, so you can interrupt it (Ctrl+C) and resume later without losing work.
On the V10 server itself (no config file needed):
sudo ./utmstack_migration_tool prepare-agentsFrom a separate workstation, with a config file:
sudo ./utmstack_migration_tool prepare-agents --config config.yaml| Flag | Description | Default |
|---|---|---|
--config, -c |
Path to the configuration file. Required for remote use. | (none) |
--db-path |
Path to the SQLite state file. | ./agents-migration.db |
The command opens a loop that:
-
Polls the AgentManager every 60 seconds
-
Detects new agents that came online and deploys to them
-
Retries failed agents with a backoff (30 s, 1 m, 2 m, 4 m, 8 m, then capped)
-
Marks agents as
goneif they disappear from the AgentManager for several cycles -
Prints a progress line per cycle, e.g.
Progress: 47 deployed | 3 pending | 2 offline | 0 failed | 0 skipped | 0 gone | total 52
The loop ends in one of three ways:
- Every agent reaches a terminal state (
deployed,skipped, orgone). - You press Ctrl+C and accept marking the remaining agents as
skipped. - The AgentManager becomes unreachable for too long (the command aborts with a clear error).
If you do not want to wait for offline agents to come back online, press Ctrl+C. The tool will:
- Stop the loop
- Show how many agents are still pending / offline / failed
- Ask whether to mark them all as
skipped
If you accept, those agents are recorded as skipped. Skipped agents will
need the migration agent installed manually after the upgrade. If you decline,
state is preserved and you can run prepare-agents again later to continue.
Run the same command again from the same directory. The SQLite state file
(agents-migration.db) keeps track of which agents are already done — they
won't be re-deployed.
Important: Run the command from the same directory every time, so it finds the same
agents-migration.db.
This command upgrades the backend on the same server. It is destructive: V10 is removed and V11 is installed in its place. There is no automatic rollback.
On the V10 server itself (recommended, no config file needed):
sudo ./utmstack_migration_tool upgradeFrom a separate workstation:
sudo ./utmstack_migration_tool upgrade --config config.yaml| Flag | Description | Default |
|---|---|---|
--config, -c |
Path to the configuration file. Optional for local upgrades. | (none) |
--data-file |
Custom name for the temporary backup file. | utmstack-upgrade-YYYYMMDD-HHMMSS.yml |
--skip-agent-check |
Skip the prepare-agents verification. Use with care. |
false |
- Confirms the destructive operation with you (you must type
yes) - Checks that
agents-migration.dbexists (proof thatprepare-agentsran) - Opens the database port
- Exports all V10 configuration data to a backup file
- Removes the V10 installation
- Downloads and installs UTMStack V11
- Imports the data back into V11
- Closes the database port
upgrade refuses to run if it can't find agents-migration.db in the current
directory. This is a safeguard so you don't forget to prepare your agents.
If you have a legitimate reason to skip it (test environment, no agents, agents
deployed by other means), pass --skip-agent-check. Any agent that did not
receive the migration agent will remain on V10 and disconnect after the upgrade.
Use this when you want to move from one server to a different one (for example, new hardware). The source V10 stays untouched until the migration succeeds.
sudo ./utmstack_migration_tool migrate --config config.yaml| Flag | Description | Default |
|---|---|---|
--config, -c |
Path to the configuration file. Required. | (none) |
--data-file |
Custom name for the data file. | utmstack-migration-YYYYMMDD-HHMMSS.yml |
The config file must define both source (V10) and destination (V11). See
Configuration file below.
- Connects to the source V10 server over SSH
- Exports all V10 data into a YAML file
- Connects to the destination V11 server over SSH
- Imports the data into V11
- Synchronizes the security key between both servers
- Asks whether to delete the temporary data file
Saves V10 data to a YAML file you can keep for later. Pairs with import.
sudo ./utmstack_migration_tool export --config config.yaml
sudo ./utmstack_migration_tool export --config config.yaml --output my-backup.yml| Flag | Description | Default |
|---|---|---|
--config, -c |
Configuration file. Required. | (none) |
--output, -o |
Output file name. | utmstack-export-YYYYMMDD-HHMMSS.yml |
Reads a YAML file produced by export and writes its content into a V11 server.
sudo ./utmstack_migration_tool import --config config.yaml --input my-backup.yml| Flag | Description | Default |
|---|---|---|
--config, -c |
Configuration file. Required. | (none) |
--input, -i |
Input file. Required. | (none) |
The config file is YAML. The shape depends on the command:
- For
upgraderunning locally on the V10 server: no file needed. - For
upgrade/prepare-agents/exportrunning remotely: onlysourceis required. - For
migrate/import:destinationis required (andsourceformigrate).
source:
host: "192.168.1.100" # V10 server IP or hostname
ssh_user: "utmstack" # SSH username
ssh_password: "your-ssh-pass" # SSH password
# ssh_private_key: "/home/me/.ssh/id_rsa" # Alternative to ssh_passwordsource:
host: "192.168.1.100"
ssh_user: "utmstack"
ssh_password: "ssh-pass-source"
destination:
host: "192.168.1.200"
ssh_user: "utmstack"
ssh_password: "ssh-pass-destination"source:
host: "192.168.1.100" # Required for remote operations
port: 5432 # PostgreSQL port (default 5432)
user: "postgres" # PostgreSQL user (default postgres)
password: "" # Auto-detected from compose.yml if empty
sslmode: "disable" # PostgreSQL SSL mode (default disable)
ssh_user: "utmstack" # SSH user (required for remote)
ssh_password: "" # SSH password
ssh_private_key: "" # Path to a private key file (alternative to ssh_password)
ssh_port: 22 # SSH port (default 22)
destination:
# Same fields as source. Used by migrate and import.Tip: You usually only need
host,ssh_user, and eitherssh_passwordorssh_private_key. The rest is auto-detected.
You are sitting on the V10 server and want to upgrade it to V11 in place.
ssh utmstack@v10-server
sudo ./utmstack_migration_tool prepare-agents
# wait until all agents are deployed (or Ctrl+C and accept skip)
sudo ./utmstack_migration_tool upgradeYou manage your V10 server from a different machine.
cat > config.yaml <<EOF
source:
host: "192.168.1.100"
ssh_user: "utmstack"
ssh_password: "your-ssh-pass"
EOF
sudo ./utmstack_migration_tool prepare-agents --config config.yaml
sudo ./utmstack_migration_tool upgrade --config config.yamlYou have a fresh V11 server and want to bring V10 data over without touching V10.
cat > config.yaml <<EOF
source:
host: "192.168.1.100"
ssh_user: "utmstack"
ssh_password: "v10-ssh-pass"
destination:
host: "192.168.1.200"
ssh_user: "utmstack"
ssh_password: "v11-ssh-pass"
EOF
sudo ./utmstack_migration_tool prepare-agents --config config.yaml
sudo ./utmstack_migration_tool migrate --config config.yamlWhen you want to back up V10 and import the data later (or to multiple V11 servers).
# Export
sudo ./utmstack_migration_tool export --config config.yaml --output backup.yml
# (Move backup.yml wherever you need it, review it, etc.)
# Import on the V11 side
sudo ./utmstack_migration_tool import --config config.yaml --input backup.ymlYou must run the tool with sudo. The configuration files live under /root/
on UTMStack V10, and only root can read them.
sudo ./utmstack_migration_tool prepare-agentsYou forgot to run prepare-agents before upgrade, or you are running
upgrade from a different directory.
Either:
- Run
prepare-agentsfirst from the same directory, or - Pass
--skip-agent-checkif you know what you are doing.
The tool can't reach the AgentManager service on the V10 server. Check that:
- The V10 server is up and
docker service lsshowsutmstack_agentmanagerrunning - Port
9000is reachable from where you are running the tool - The internal key in
/root/utmstack.ymlhas not been modified by hand
The tool looks for compose.yml in these locations, in order:
~/compose.yml(the home directory of the user running the tool)/root/compose.yml/home/utmstack/compose.yml
If your compose.yml lives elsewhere, copy or symlink it into one of those
paths, or run the tool from a directory where it can be found.
Check that:
- The SSH credentials in
config.yamlare correct - SSH (port 22 by default) is reachable from your machine
- You can connect manually:
ssh utmstack@<host> - If you use
ssh_private_key, the file path is correct and the key is unencrypted
That is expected if those agents are physically off, on a laptop that's closed, or behind an unreachable network. You have two options:
- Keep
prepare-agentsrunning and wait for them to come back - Press Ctrl+C, accept marking them as
skipped, runupgrade, and install the migration agent on those machines manually later
The tool uses ON CONFLICT DO UPDATE, so re-running the import is safe — it
won't duplicate data. Fix the underlying issue (for example, a constraint in
V11) and run import again.
| File | Created by | Purpose |
|---|---|---|
agents-migration.db |
prepare-agents |
Tracks which agents already received the migration agent. Keep it until upgrade is done. |
utmstack-upgrade-<timestamp>.yml |
upgrade |
Temporary backup of V10 data. The tool reuses it during the upgrade. |
utmstack-migration-<timestamp>.yml |
migrate |
Temporary data file. You will be asked whether to delete it at the end. |
utmstack-export-<timestamp>.yml |
export |
Your V10 data dump. Keep it for as long as you need. |
- Run any command with
--helpto see all its options. - Open an issue at the project's GitHub repository if you hit a real bug.