Also Update Let's Encrypt Paths if Moving Domain to Another Account
This commit is contained in:
parent
d38ac0c957
commit
cce0c89ebd
1 changed files with 4 additions and 0 deletions
|
@ -7973,6 +7973,7 @@ email2@domain2.com:password2<br>
|
|||
|
||||
$currentHome = $domainInfo["homedir"];
|
||||
$newHome = "/var/www/vhosts/" . $newAccountFTPLogin;
|
||||
$newHomeFullPath = $newHome . "/" . $domainInfo["domainname"];
|
||||
|
||||
// Update associations in the database.
|
||||
$success = $success && $this->executeQuery("update " . $this->conf['domainstable']['tablename'] . " set homedir= '" . $newHome . "/" . $domainInfo["domainname"] . "', panelusername = '" . $movetopaneluser . "', reseller = '" . $resellerOfAccount . "' where domainname = '" . $domainInfo["domainname"] . "';");
|
||||
|
@ -7990,6 +7991,9 @@ email2@domain2.com:password2<br>
|
|||
// Move files to the new home directory
|
||||
$success = $success && $this->runCommandInDaemon("mkdir -p " . $newHome . "/" . $domainInfo["domainname"] . " && cp -R " . $currentHome . "/* " . $newHome . "/" . $domainInfo["domainname"] . " && rm -rf " . $currentHome . " && chown -R " . $this->ftpuser . ":www-data " . $newHome . "/" . $domainInfo["domainname"]);
|
||||
|
||||
// Update any let's encrypt configuration paths
|
||||
$success = $success && $this->runCommandInDaemon('sed -i "s#' . $currentHome . '#' . $newHomeFullPath . '#g" /etc/letsencrypt/renewal/' . $domainInfo["domainname"] . '.conf');
|
||||
|
||||
// Sync FTP accounts
|
||||
$success = $success && $this->addDaemonOp('syncftp', '', '', '', 'sync ftp for nonstandard homes');
|
||||
|
||||
|
|
Loading…
Reference in a new issue