From 8697f5dbc0a65c1f55dd1d8d598a85a5d4028d64 Mon Sep 17 00:00:00 2001 From: "usman@cyberpersons.com" Date: Tue, 6 Dec 2022 14:34:49 +0500 Subject: [PATCH] bug fix: when backup taken from openlitespeed is restored on lsws ent server, it created an issue --- plogical/backupUtilities.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/plogical/backupUtilities.py b/plogical/backupUtilities.py index b61984d07..1d3128dce 100755 --- a/plogical/backupUtilities.py +++ b/plogical/backupUtilities.py @@ -776,6 +776,15 @@ class backupUtilities: 1] + ". Not able to create Account, Databases and DNS Records, aborting. [575][5009]") return 0 + #### Find out web server from backup conf + + CurrentServer = ProcessUtilities.OLS + + if os.path.exists(completPath + '/vhost.conf'): + if open(f'{completPath}/vhost.conf', 'r').read().find('ServerName') > -1: + CurrentServer = ProcessUtilities.ent + + ########### Creating child/sub/addon/parked domains logging.CyberCPLogFileWriter.statusWriter(status, "Creating Child Domains!") @@ -819,7 +828,8 @@ class backupUtilities: if os.path.exists(completPath + '/' + domain + '.vhost.conf'): completPathToConf = backupUtilities.Server_root + '/conf/vhosts/' + domain + '/vhost.conf' - copy(completPath + '/' + domain + '.vhost.conf', completPathToConf) + if CurrentServer == ProcessUtilities.decideServer(): + copy(completPath + '/' + domain + '.vhost.conf', completPathToConf) sslStoragePath = completPath + "/" + domain + ".cert.pem" @@ -1030,7 +1040,8 @@ class backupUtilities: completPathToConf = backupUtilities.Server_root + '/conf/vhosts/' + masterDomain + '/vhost.conf' if os.path.exists(completPath + '/vhost.conf'): - copy(completPath + '/vhost.conf', completPathToConf) + if CurrentServer == ProcessUtilities.decideServer(): + copy(completPath + '/vhost.conf', completPathToConf) logging.CyberCPLogFileWriter.statusWriter(status, "Done")