Skip to Content

Migrate jump server installation from one server to another

How do I migrate jump server installation from one server to another?


How to move the Ezeelogin bastion host from one server to another(MIGRATION)?

1. If you are using the Ezeelogin master-slave configuration, you should verify and confirm database is in sync. Refer to below article to verify database connectivity.

2. Run the script /usr/local/sbin/backup_ezlogin.php on the current server to create the backup archive.

    The backup archive would be created in /var/ezlogin.xx.bin

root@old_primary_server ~]# /usr/local/sbin/backup_ezlogin.php

root@old_primary_server ~]# ls /var/

ezlogin_backup_v7.27.6_b381_Sat_May_21_2022_14_33_28_UTC.bin

The contents in users home directories will not be backed up automatically.You will need to manually transfer the contents, including the keys, to the new primary server.

The directory /var/log/ezlogin stores the user ssh sessions that are recorded. This directory could run into huge size ( 1GB >) which would cause the backup script to take long to complete ( The log directory has to be tar'ed and then gzip'ed compressed which is time-consuming and resource intensive).  In such, cases its advisable to skip the log directory while running the backup script as follows.

[root@jumpserver ~]#    /usr/local/sbin/backup_ezlogin.php -nologs

After restoring a backup, you would need to copy or rsync /var/log/ezlogin directory to the new server. 

root@old_primary_server ~]# rsync -rt /var/log/ezlogin/* root@new_primary_ip:/var/log/ezlogin/

3. Make sure that Ezeelogin licensed IP is changed to new IP from the customer portal.

If you are using an owned license, then you can skip this step.

4. Make sure that the new server has the same versions of PHP and MySQL server, and also install the webserver, PHP modules, and ioncube. Refer to below article to install it in different OS.

5. Move the executable ezlogin.xx.bin archive to the new server, and execute the .bin file.

root@old_primary_server ~]# scp /var/ezlogin_backup_v7.27.6_b381_Sat_May_21_2022_14_33_28_UTC.bin root@new_server_ip:/root/

root@new_primary_server ~]# sh ezlogin.xx.bin

Follow the on-screen instructions and confirm everything is working in the new server such as (login to GUI, Ezsh shell, remote server, etc.)

In case of any error, while restoring check the restore log. Refer to the below step to find the log.

root@new_primary_server ~]# tail /var/log/ezlogin_restore.log

Refer to the below article to fix the PHP limit error while restoring.


How to restore slave/secondary installation?

We don't need to migrate and restore the slave/secondary node, as the master and slave nodes are identical. We can install a slave node identical to the master node.  Refer to the below article to install the slave node.

 How to restore logs from the old slave server to the new slave server?

You can use the following steps to restore logs in primary when you skip the log directory from backup.

1. Copy logs from old slave server to new slave. Run the below command on the old slave server.

root@old_slave_server ~]# rsync -rt /var/log/ezlogin/* root@new_slave_ip:/var/log/ezlogin

2. Run the below script on the new slave server to repopulate SSH logs.

root@new_slave_server ~]# /usr/local/ezlogin/eztool.php -reimport_logs

3. Click on the view icon on the new slave Ezeelogin SSH log from GUI to confirm log files have been copied and repopulated. Refer below screenshot.

ezeelogin_ssh_log