Move to a new server
Your Qubix license is not tied to the server's hardware. One license runs one copy of Qubix at a time: our licensing server counts the copy that is running. The license travels with your data — when you move the data to a new server and start Qubix there, it keeps working without a new activation code. A new motherboard, another processor or a cloud server that changes its hardware on restart changes nothing.
Keep the old copy stopped: while it runs, the new one waits and shows that another copy is running on the license; it starts by itself a few minutes after the old one stops.
The flow
Steps
- On the old server — stop the stack so the databases are in a consistent state. Some Qubix
services run as separate Docker stacks that
docker compose downdoes not touch, so stop the remaining containers too (this stops every container on the server — Qubix normally has the server to itself):Bashcd /opt/qubix && docker compose downdocker ps -q | xargs -r docker stop - Copy the instance directory to the new server. Your instance lives in two places: the
/opt/qubixdirectory and Docker volumes (the next step). The directory holds:- the database folder under
/opt/qubix/data— your database (all stats, campaigns, events and settings); /opt/qubix/data/letsencrypt— your TLS certificates;- the vector-store folder under
/opt/qubix/data— the search-by-meaning data; /opt/qubix/data/qubix— the backend's local state;/opt/qubix/.env— your settings and secrets;/opt/qubix/docker-compose.yml— the stack definition.
Because you stopped the stack in step 1, the database is shut down cleanly and its files are consistent — a plain copy is enough, no separate database dump is needed. The web-server configuration is rebuilt automatically on first start.Bashssh newserver 'mkdir -p /opt/qubix'rsync -a /opt/qubix/ newserver:/opt/qubix/ - the database folder under
- Copy the Docker volumes to the new server. Some of the data is kept in Docker volumes, not
in
/opt/qubix, and a copy of the directory alone loses it. Run this on the old server: it streams every volume straight to the new one, so the old disk needs no free space. The new server holds the archives and the restored volumes at the same time, so it needs about twice the volumes' size free: see the sizes withdocker system df -von the old server and the free space withdf -h /on the new one.A line ending withBashset -o pipefailssh newserver 'mkdir -p /root/qubix-volumes'for v in $(docker volume ls -q); dodocker volume inspect -f '{{range $k, $l := .Labels}}{{if ne $k "com.docker.compose.config-hash"}}--label {{$k}}={{$l}} {{end}}{{end}}' "$v" |ssh newserver "cat > /root/qubix-volumes/$v.labels" &&docker run --rm -v "$v":/volume:ro alpine tar --numeric-owner -C /volume -czf - . |ssh newserver "cat > /root/qubix-volumes/$v.tar.gz" ||echo "NOT COPIED: $v"donesocket ignoredis expected: sockets are recreated on start. If the loop printsNOT COPIED, fix the cause and run it again. - Restore the volumes on the new server (Docker must already be installed there), before
the first start:
The loop never writes into a volume that already holds data: mixing two sets of database files would corrupt the database.Bashcd /root/qubix-volumesfor f in *.tar.gz; dov=${f%.tar.gz}docker volume create $(cat "$v.labels") "$v" >/dev/nullif [ -n "$(docker run --rm -v "$v":/volume alpine ls -A /volume)" ]; thenecho "SKIPPED (not empty): $v"elif ! docker run --rm -v "$v":/volume -v /root/qubix-volumes:/backup:ro alpine \tar --numeric-owner -C /volume -xzpf "/backup/$f"; thenecho "FAILED: $v"fidone
SKIPPED (not empty)— the volume already existed on the new server. Find out what created it before going on.FAILED— the volume is written only partly (usually the disk ran out of space). Remove it withdocker volume rm <volume>, fix the cause and run the loop again: volumes restored before are skipped.
- Start the stack:
Qubix starts with the license it brought along with the data, without a new code. The remaining services come up by themselves a few minutes later, on the restored volumes.Bashcd /opt/qubix && docker compose pull && docker compose up -d
- Delete the volume archives once you have made sure the statistics and the rest of the data
are in place on the new server — they are an unprotected copy of your data:
Bashrm -rf /root/qubix-volumes
The strip at the top of the new copy's panel then reads Another copy of Qubix is running on this license. — see The strip at the top of the panel. The old copy is still running. Stop it on the old server — the new one starts by itself a few minutes later:
cd /opt/qubix && docker compose stop qubixd
Before a move, always keep a backup of /opt/qubix/data and of the Docker volumes off this
server — they are your analytics database and the rest of the Qubix data.