Reinstalling or migrating to a new machine and keeping the current configuration (v9)
This article applies to NoMachine 9 installations and later.
It's possible to make a backup of the current configuration of a server installation by running the following command. This works for all NoMachine server types, included the Free Edition and for Terminal Server Node installations.
On Linux and macOS:
$ /etc/NX/nxserver --configsave
On Windows:
> %ALLUSERSPROFILE%\NoMachine\nxserver\nxserver.exe --configsave
This command creates a zip archive of the current configurations:
- server and node.cfg
- redis DB
- NoMachine keys and certificates
List of copied files (path from Linux):
/usr/NX/etc/server.cfg
/usr/NX/etc/node.cfg
/usr/NX/var/db/server.db
/usr/NX/etc/uuid
/usr/NX/etc/keys - whole directory
/var/NX/nxhtd/.nx/config/hosts.crt
/var/NX/nx/.nx/config/hosts.crt
/var/NX/nx/.ssh/known_hosts
The configuration archive is saved in the directory where the 'nxserver --configsave' command is executed and it is named in the following format: NoMachine-configuration-bck-<timestamp>.zip, e.g. NoMachine-configuration-bck-2022.05.23-09.56.47.zip
You can change location by providing the --path <path> option:
nxserver --configsave --path path_to_directory
When to use the configuration backup
1) To preserve custom configurations, when it's necessary to uninstall the current server for whatever reason and install it again.
2) To migrate the current server installation to a different machine, even running a different Operating System. (E.g. migrate from Windows to Linux).
3) In the case of multi-node setup, to preserve the current list of nodes and avoid readding and configuring them manually after a reinstall or a host migration.
How to restore the configuration backup
Once NoMachine server is installed, run the following command:
On Linux and macOS:
$ /etc/NX/nxserver --configrestore --path <path>
On Windows:
> %ALLUSERSPROFILE%\NoMachine\nxserver\nxserver.exe --configrestore --path <path>
