mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-12 16:26:12 +01:00
bug fix: to website restore to new domain
This commit is contained in:
@@ -2463,8 +2463,13 @@ class ApplicationInstaller(multi.Thread):
|
|||||||
BackupDestination = 'Local'
|
BackupDestination = 'Local'
|
||||||
SFTP_ID = None
|
SFTP_ID = None
|
||||||
|
|
||||||
|
from plogical.phpUtilities import phpUtilities
|
||||||
|
vhFile = f'/usr/local/lsws/conf/vhosts/{wpsite.owner.domain}/vhost.conf'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
website = wpsite.owner
|
website = wpsite.owner
|
||||||
PhpVersion = website.phpSelection
|
PhpVersion = phpUtilities.WrapGetPHPVersionFromFileToGetVersionWithPHP(vhFile)
|
||||||
VHuser = website.externalApp
|
VHuser = website.externalApp
|
||||||
WPsitepath = wpsite.path
|
WPsitepath = wpsite.path
|
||||||
websitedomain = website.domain
|
websitedomain = website.domain
|
||||||
@@ -6142,6 +6147,7 @@ class ApplicationInstaller(multi.Thread):
|
|||||||
DataToPass['Themes'] = config['WPThemeUpdates']
|
DataToPass['Themes'] = config['WPThemeUpdates']
|
||||||
DataToPass['websiteOwner'] = WebOwner
|
DataToPass['websiteOwner'] = WebOwner
|
||||||
DataToPass['package'] = packegs
|
DataToPass['package'] = packegs
|
||||||
|
DataToPass['apacheBackend'] = 0
|
||||||
try:
|
try:
|
||||||
oldpath = config['WPsitepath']
|
oldpath = config['WPsitepath']
|
||||||
abc = oldpath.split("/")
|
abc = oldpath.split("/")
|
||||||
@@ -6177,17 +6183,30 @@ class ApplicationInstaller(multi.Thread):
|
|||||||
logging.statusWriter(self.tempStatusPath, 'Creating WordPress....,20')
|
logging.statusWriter(self.tempStatusPath, 'Creating WordPress....,20')
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
logging.statusWriter(self.tempStatusPath, 'Restoring site ....,30')
|
logging.statusWriter(self.tempStatusPath, 'Restoring site ....,30')
|
||||||
NewWPsite = WPSites.objects.get(FinalURL=newurl)
|
NewWPsite = WPSites.objects.get(FinalURL=newurl)
|
||||||
VHuser = NewWPsite.owner.externalApp
|
VHuser = NewWPsite.owner.externalApp
|
||||||
PhpVersion = NewWPsite.owner.phpSelection
|
PhpVersion = NewWPsite.owner.phpSelection
|
||||||
newWPpath = NewWPsite.path
|
newWPpath = NewWPsite.path
|
||||||
|
|
||||||
|
#### change PHP version of newly created site to the one found in the config
|
||||||
|
|
||||||
|
from plogical.vhost import vhost
|
||||||
|
vhFile = f'/usr/local/lsws/conf/vhosts/{NewWPsite.owner.domain}/vhost.conf'
|
||||||
|
execPath = "/usr/local/CyberCP/bin/python /usr/local/CyberCP/plogical/virtualHostUtilities.py"
|
||||||
|
execPath = execPath + f" changePHP --phpVersion '{config['WebphpSelection']}' --path " + vhFile
|
||||||
|
ProcessUtilities.popenExecutioner(execPath)
|
||||||
|
|
||||||
###### Same code already used in Existing site
|
###### Same code already used in Existing site
|
||||||
|
|
||||||
### get WPsite Database name and usr
|
### get WPsite Database name and usr
|
||||||
php = PHPManager.getPHPString(PhpVersion)
|
from plogical.phpUtilities import phpUtilities
|
||||||
FinalPHPPath = '/usr/local/lsws/lsphp%s/bin/php' % (php)
|
|
||||||
|
vhFile = f'/usr/local/lsws/conf/vhosts/{NewWPsite.owner.domain}/vhost.conf'
|
||||||
|
FinalPHPPath = phpUtilities.GetPHPVersionFromFile(vhFile, NewWPsite.owner.domain)
|
||||||
|
|
||||||
######Get DBname
|
######Get DBname
|
||||||
command = 'sudo -u %s %s -d error_reporting=0 /usr/bin/wp config get DB_NAME --skip-plugins --skip-themes --path=%s' % (
|
command = 'sudo -u %s %s -d error_reporting=0 /usr/bin/wp config get DB_NAME --skip-plugins --skip-themes --path=%s' % (
|
||||||
|
|||||||
Reference in New Issue
Block a user