Skip to main content

Changing Host Systems

There are several options for moving a Xylok installation from on host machine to another, including:

  • Exporting and restoring the entire client archive from the Client page
  • Performing a database backup and restore, see Backups
  • Copying the raw database data and configuration to the new system

The final approach will result in an identical installation on the new system, including any current backups and system settings. The instructions below cover this third process.

Terminology

The commands shown are intended to be robust to copy/pasting directly into the command line or as part of a script. "New" refers to the host Xylok is being installed onto, "existing" is the host with the current Xylok installation.

  1. On the existing installation, update to the same version of Xylok as you will be installing on the new system (if possible).

  2. On the existing installation, run these commands as root:

    # Stop Xylok
    systemctl stop xylok
    # Back up all current data
    currdir="$(pwd)"
    cd "$(mktemp -d)"
    cp -r /var/lib/xylok db/
    cp /etc/xylok.conf .
    cp -r /opt/xylok/ opt/
    tar -cvzf "$currdir/xylok-complete.tar.gz" *
    cd "$currdir"
    ls -lh xylok-complete.tar.gz
  3. Copy the xylok-complete.tar.gz file from the existing system to the new system.

  4. On the new system install Xylok as a "new" installation. At the end ignore the prompt to create an initial superuser—this information will be blown away when the backup is restored.

  5. On the new system run these commands as root, with the backup tar file in the current directory:

    # Stop Xylok
    systemctl stop xylok
    # Extract the tar file
    currdir="$(pwd)"
    cd "$(mktemp -d)"
    cp "$currdir/xylok-complete.tar.gz" .
    tar xaf *.gz
    # Restore data. Unalias is to get rid of the copy prompt
    # Note the "." in the cp commands
    unalias cp
    cp xylok.conf /etc/xylok.conf
    cp -r opt/. /opt/xylok/
    cp -r db/. /var/lib/xylok/
    cd "$currdir"
    # Restart Xylok
    systemctl start xylok
    # Ensure database is migrated
    /opt/xylok/run-management-cmd.sh migrate
  6. On the new system, access Xylok via the web browser and ensure everything is correct. Xylok may take a minute to fully start, so if you encounter a "not found" error initially try again after a few seconds.

If you encounter an issue with this process, feel free to contact [email protected] for additional help.