Knowledge Base
Searching in : Article
ID: AR02T01153
Applies to: NoMachine Server
Added on: 2022-02-17
Last Update: 2023-01-17

How to migrate NoMachine 7 configurations to a new machine

This article applies to the NoMachine version 7.

Let's call 'machine A' the original NoMachine server host and 'machine B' the new host where you want to migrate.

Currently, it's not possible to migrate running sessions from one machine to another. Session processes are resident in memory on the host where they have been started and cannot be moved, However, it's still possible to migrate configurations. For example, if you have a multi-node server or have some profile rules set, you can move such settings to the new machine without the need for reconfiguring them.

Pre-requisites for migrating configurations and switching to the new machine are:

a) All the necessary system accounts are created on the new machine.
This is necessary to ensure that all users who were connecting to machine A are then able to connect to machine B.

b) The NoMachine server type and version on machine B is the same installed on machine A.
Having the same server type on both machines ensures that settings from machine A can be applied to machine B. If you want to update your installation, you can do that on machine B once migration is completed

c) The IP Address of the Machine A should be applied on the Machine B in order that all nodes function correctly
 

Procedure for migrating configurations

1. Shutdown the server for example from command line

    - Linux/ Mac: sudo /etc/NX/nxserver --shutdown
    - Windows: "%ProgramFiles(x86)%\NoMachine\bin\nxserver" --shutdown

2. Create backup and transfer following files from machine A to machine B on the same path and restore same permissions.

     2.1. Files located in the installationDirectory/etc folder
            To be copied: uuid, nxdb, server.cfg, node.cfg, htd.cfg, and keys folder

     2.2. If folders .nx and .ssh exists in the default home folder path for the user nx located on:

            Linux:  /var/NX/nx/
            Mac OS: "/Library/Application Support/NoMachine/var/nx/"
            Windows:   C:\Users\nx\
          
           Files to be copied: .nx/config/*.crt, .ssh/known_hosts

     2.3 In order for WebPlayer to work correcty after transfering settings to the new host we need to copy    
           configuration files from nxhtd folder located on:

            Linux:        /var/NX/nxhtd/
            Mac OS:    "/Library/Application Support/NoMachine/var/nxhtd/"
            Windows:   "%ProgramData%\NoMachine\nxhtd"

            Files to be copied: .nx/config/*.crt, .ssh/known_hosts  

3. Check that server/node/htd.cfg configuration files match. If you have changed default configurations in server.cfg, node.cfg, and htd.cfg you have to compare the cfg file(s) from machine A with the cfg file(s) on machine B and apply the necessary changes on machine B.

Important: do not simply copy *cfg files from machine A to machine B, unless machine B is a perfect clone of machine A (i.e. it has the same operating system, version, and programs). Some configuration keys are strictly dependent on the environment setting.

4. Startup the server

    - Linux/ Mac:   sudo /etc/NX/nxserver --startup
    - Windows:       "%ProgramFiles(x86)%\NoMachine\bin\nxserver" --startup