how to create a complete backup of ezeelogin installation?
How do I create a complete backup of my Ezeelogin installation?
Overview: The article explains how to efficiently create and restore Ezeelogin backups by skipping large log directories to speed up the process, while ensuring the proper configuration for a successful restoration.
Step 1: Execute the command /usr/local/sbin/backup_ezlogin.php and this would create a binary executable backup archive in /var/ezlogin_backup_xx_x.bin.
The directory /var/log/ezlogin stores the user SSH sessions that are recorded. This dir could run into a huge size ( 1GB >) which would cause the backup script to take longer to complete ( The log dir has to be tarred and then gzip'ed compressed which is time-consuming and resource intensive). In such, cases it's advisable to skip the log directory while running the backup script as follows.
root@gateway:~# /usr/local/sbin/backup_ezlogin.php -nologs
Make sure to back up /var/log/ezlogin when you backup ezeelogin with the nologs option.
root@gateway:~# cp -pr /var/log/ezlogin /var/log/ezlogin_backup
root@gateway:~# /usr/local/sbin/backup_ezlogin.php
_ _
___ _______ ___| | ___ __ _(_)_ __
/ _ \_ / _ \/ _ \ |/ _ \ / _` | | '_ \
| __// / __/ __/ | (_) | (_| | | | | |
\___/___\___|\___|_|\___/ \__, |_|_| |_|
|___/
#########################
# Ezeelogin Backup #
#########################
Checking environment...
done
Based on your command line arguments, you may be prompted to enter the missing settings. The default value will be given in bold. Simply pressing enter key will choose the default value.
Creating directories... done
Copying files... done
Backup database... done
Backup logs... done
Creating executable archive... done
########################################################
Ezeelogin backup created: /var/ezlogin_backup_v7.37.10_b381_p8.2.20_Sat_Jun_20_2024_09_02_32_UTC.bin
(Log: /var/log/ezlogin_backup.log)
########################################################
For free assistance, please contact [email protected]
Thank you for choosing Ezeelogin.
www.ezeelogin.com
- You may store this backup archive generated in /var/ezlogin_backup.x.x remotely, in case you need to restore it when your primary node is unrecoverable.
- When your primary node goes down, all you need is to migrate the license to the new IP from the portal and execute the backup archive on the server and you are ready to go.
Step 2: To restore Ezeelogin, simply execute the archive created.
root@gateway:~# /var/ezlogin_backup_v7.37.10_b381_p8.2.20_Sat_Jun_20_2024_09_02_32_UTC.bin
Creating directory ezlogin_backup_v7.8.0_b381_Sat_Jun_20_2024_09_10_32_UTC
Verifying archive integrity... All good.
Uncompressing Ezeelogin 7.8.0 backup (Thu_Oct_04_2018_09_10_32_UTC).............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
/ _ \_ / _ \/ _ \ |/ _ \ / _` | | '_ \
| __// / __/ __/ | (_) | (_| | | | | |
\___/___\___|\___|_|\___/ \__, |_|_| |_|
|___/
#########################
# Ezeelogin Restore #
#########################
done (1797)
Required PHP extensions...
mysqli -> Success
openssl -> Success
posix -> Success
pcre -> Success
json -> Success
curl -> Success
mcrypt -> Success
Required PHP functions...
exec -> Success
proc_open -> Success
proc_close -> Success
fopen -> Success
fsockopen -> Success
file -> Success
file_get_contents -> Success
escapeshellarg -> Success
preg_match -> Success
ini_get -> Success
Operating system: Linux (x86_64)
PHP version: 5.3.3
done (1863)
Based on your command line parameters, you may be prompted to enter the missing settings. The default value will be given in bold . Simply pressing enter key will choose the default value.
Checking database connectivity.done (3107)
Checking database availability.done (3121)
Review settings:
Install web panel files in : /var/www/html/ezlogin/
Install web panel system files in : /var/www/ezlogin/
URI path to access web panel : /ezlogin/
MySQL server : localhost
MySQL port/socket : /var/lib/mysql/mysql.sock
Force HTTPS for web panel? : no
Secure MySQL connection? : no
Accept the above settings? ( y /n/x) : y
Creating and setting up database... done
Adding ezsh to shells... done
Creating group and users... done
Restoring logs... done
Creating directories... done
Copying files... |
ERROR copying: setup/crontab -> ezadmin
done
Setting access...
done
Setting file modes
done
Setting file owners...
done
Setting file groups...
ERROR chgrp: ezadmin -> root
done
Setting up config... done
Setting up cron... done
Downloading GeoLiteCity database from www.maxmind.com... /root/ezlogin_backup_v7.8.0_b381_Sat_Jun_20_2024_09_10_32_UTC/setup/setup.php on line
done
########################################################
Ezeelogin restored. (Log: /var/log/ezlogin_restore.log )
########################################################
Please check the log file.
For assistance, please contact support with the content of the log file.
###################################################################
Web panel installed at:
' /var/www/html/ezlogin/ '
( http://yourdomain.com/ezlogin/ ).
###################################################################
Note: Please check the log file to see if any error occurred.
TODO NOTES:
Enable web server, MySQL server and cron to startup at boot time.
For free assistance, please contact [email protected]
Thank you for choosing Ezeelogin.
www.ezeelogin.com
Step 2(A): Following shows the help menu for restoring Ezeelogin
root@gateway:~# /var/ezlogin_backup_v7.37.11_b381_p8.2.20_Sat_Jun_29_2024_09_02_32_UTC.bin -- -help
Creating directory ezlogin_backup_v7.37.11_b381_p8.2.20_Sat_Jun_29_2024_09_02_32_UTC
Verifying archive integrity... 100% MD5 checksums are OK. All good.
Uncompressing Ezeelogin 7.37.11 backup (PHP 8.2.20, Sat_Jun_29_2024_09_02_32_UTC) 100%
_ _
___ _______ ___| | ___ __ _(_)_ __
/ _ \_ / _ \/ _ \ |/ _ \ / _` | | '_ \
| __// / __/ __/ | (_) | (_| | | | | |
\___/___\___|\___|_|\___/ \__, |_|_| |_|
|___/
#########################
# Ezeelogin Restore #
#########################
Options:
-help : Show this help
-version : Show the version
-www <path> : Path from where web server will serve the web panel files
-sys <path> : Path where web panel will search for its system files
-uri <path> : Request URI path to access the web panel
-dbhost <host> : Specify hostname or IP address of MySQL server
-dbport <port> : Specify the port MySQL server is listening on
-dbsuser <username> : Specify database super (root) user name
-dbspass <password> : Specify database super (root) user password
-force_https <yes/no> : Whether to force HTTPS for web panel
-noauto : Prompt for options
-usebin <absolute_path> : Use the provided binary package instead of downloading
-lic_timeout <seconds> : Timeout for connecting to Ezeelogin license server. Default: 30
-proxy_host <host> : Proxy host for connecting to Ezeelogin license server
-proxy_port <port> : Proxy port for connecting to Ezeelogin license server
-proxy_user <username> : Proxy user for connecting to Ezeelogin license server
-proxy_pass <password> : Proxy pass for connecting to Ezeelogin license server
-mysql_encrypt <yes/no> : Whether to enable secure mysql connection
-mysql_ssl_key <absolute_path> : Path to the private key file for secure MySQL connection
-mysql_ssl_cert <absolute_path> : Path to the public key certificate file for secure MySQL connection
-mysql_ssl_ca <absolute_path> : Path to the certificate authority file for secure MySQL connection
-mysql_ssl_capath <absolute_path> : Path to a directory containing trusted CA certificates for secure MySQL connection
-mysql_ssl_cipher <ciphers> : List of *allowed* ciphers to be used for the encryption, separated by colons (':')
-mysql_ssl_verify <yes/no> : Whether to verify the server certificate for secure MySQL connection
Step 3: To restore the Ezeelogin database on a different database host, specify the DB host, port, and other relevant details during the restoration process.
Here is an example of restoring Ezeelogin on a remote database. Replace dbhost, dbport, dbuser and dbspasswd with the correct values
root@gateway:~# sh ezlogin_backup_v7.37.10_b381_p8.2.20_Sat_Jun_20_2024_09_02_32_UTC.bin -- -dbhost 192.168.1.8 -dbport 3306 -dbsuser root -dbspasswd OvJGZGfmXHrjUpM
Step 4: Follow the step below if you want to do the restore in one step with your existing settings and without being prompted. Replace the backup filename with your own backup file.
root@gateway:~# sh ezlogin_backup_v7.37.10_b381_p8.2.20_Sat_Jun_20_2024_09_02_32_UTC.bin -- -skipgeolite -auto -force -ACCEPT_SETTINGS -I_ACCEPT_EULA
You need to check the /var/log/ezlogin_backup.log and /var/log/ezlogin_restore.log to see if any errors occurred during the backup and restore process
Related Articles:
How to change the default backup directory of the Ezeelogin installation?
Migrate jump server installation from one server to another
How to move servers/migrate servers from one Ezeelogin installation to another?