Server Migration
This page covers moving a NetXMS server installation to a new machine — whether for hardware replacement, OS migration, or moving to the cloud.
For migrating between different database engines (e.g., SQLite to PostgreSQL), see Database Migration.
Before You Begin
| Always create a full backup before starting any migration. See Backup and Recovery for backup procedures. |
Pre-Migration Checklist
-
Back up the database using your database engine’s native backup tool
-
Back up the server configuration file (
netxmsd.conf) -
Back up the server data directory
-
Note the current NetXMS version (
netxmsd -v) — install the same version on the new server -
Plan agent reconnection (DNS update or configuration changes)
-
Schedule a maintenance window
Scenario 1: External Database
When the database runs on a separate server (or a managed cloud database), migration is straightforward because the database stays in place.
-
Install NetXMS on the new server (same version as the source)
-
Copy the configuration file from the old server:
scp old-server:/etc/netxmsd.conf /etc/netxmsd.conf -
Review
netxmsd.confand update any paths or settings specific to the old server (log file path, data directory, etc.) -
Stop the server on the old machine:
sudo systemctl stop netxms-server -
Copy the data directory from the old server:
rsync -a old-server:/var/lib/netxms/ /var/lib/netxms/ -
Start the server on the new machine:
sudo systemctl start netxms-server
| No database migration is needed in this scenario. The new server connects to the existing external database using the same credentials. |
Scenario 2: Database on the Same Machine
When the database runs on the same machine as the NetXMS server, the database must also be moved.
Same Database Engine on the New Server
If you are keeping the same database engine (e.g., PostgreSQL on both old and new servers), use the engine’s native dump and restore tools.
This is faster and more efficient than using nxdbmgr.
PostgreSQL
On the old server:
sudo systemctl stop netxms-server
pg_dump -U netxms -Fc netxms_db > /tmp/netxms-db.dump
On the new server (after installing NetXMS and PostgreSQL):
createdb -U netxms netxms_db
pg_restore -U netxms -d netxms_db /tmp/netxms-db.dump
MySQL / MariaDB
On the old server:
sudo systemctl stop netxms-server
mysqldump -u netxms -p netxms_db > /tmp/netxms-db.sql
On the new server (after installing NetXMS and MySQL):
mysql -u netxms -p netxms_db < /tmp/netxms-db.sql
Microsoft SQL Server
On the old server:
BACKUP DATABASE netxms_db TO DISK = 'C:\temp\netxms-db.bak' WITH COMPRESSION;
Restore on the new server using RESTORE DATABASE or SQL Server Management Studio.
After restoring the database, copy the configuration file and data directory to the new server (see Copying the Data Directory below), then start the server.
Changing Database Engine
If you want to switch to a different database engine as part of the migration (e.g., moving from MySQL to PostgreSQL), use the nxdbmgr migrate command.
See Database Migration for the full procedure.
Copying the Data Directory
The NetXMS server data directory contains files that are not stored in the database and must be copied separately.
Default locations:
-
Linux:
/var/lib/netxms/ -
Windows:
C:\NetXMS\var
The directory contains:
| Subdirectory | Contents |
|---|---|
|
SNMP MIB files and compiled MIB cache |
|
User-uploaded files |
|
Agent upgrade packages |
|
Uploaded images |
|
Dashboard background images |
|
Server certificates (including the CA used for agent tunnel certificates) |
|
Certificate Revocation Lists |
|
Housekeeper working files (transient, can be skipped) |
Copy the entire data directory to the new server:
rsync -a old-server:/var/lib/netxms/ /var/lib/netxms/
robocopy "\\old-server\c$\NetXMS\var" "C:\NetXMS\var" /E
Ensure the ownership and permissions are correct on the new server:
chown -R netxms:netxms /var/lib/netxms/
Post-Migration Steps
Verify Server Starts
Start the server and check the log for errors:
sudo systemctl start netxms-server
tail -100 /var/log/netxmsd
Verify Data
-
Check node count matches the original system
-
Verify recent DCI data is present
-
Confirm event log contains historical entries
-
Review server configuration variables
Agent Reconnection
After migration, agents need to connect to the new server address.
DNS-Based Agent Configuration
If agents use a DNS hostname to connect, update the DNS record to point to the new server’s IP address. Agents reconnect automatically on the next connection attempt.
IP-Based Agent Configuration
If agents are configured with the server’s IP address, update agent configuration on each host:
-
Agents using tunnel connections: update the
ServerConnectionsection innxagentd.conf -
Agents using direct connections: update
MasterServers,ControlServers, andServersparameters innxagentd.conf
| For large environments, use NetXMS agent policies to push updated configuration to all agents before shutting down the old server. |