ftimme
2013-01-30 1a541271a5e331a2bdab764662c69532bffaff81
- Fixed FS#2646 - Moving website to another client not working.
2 files modified
12 ■■■■■ changed files
server/plugins-available/apache2_plugin.inc.php 6 ●●●●● patch | view | raw | blame | history
server/plugins-available/nginx_plugin.inc.php 6 ●●●●● patch | view | raw | blame | history
server/plugins-available/apache2_plugin.inc.php
@@ -432,12 +432,14 @@
            //* Check if there is already some data in the new docroot and rename it as we need a clean path to move the existing site to the new path
            if(@is_dir($data['new']['document_root'])) {
                $app->system->rename($data['new']['document_root'],$data['new']['document_root'].'_bak_'.date('Y_m_d'));
                $app->log('Renaming existing directory in new docroot location. mv '.$data['new']['document_root'].' '.$data['new']['document_root'].'_bak_'.date('Y_m_d'),LOGLEVEL_DEBUG);
                $app->system->web_folder_protection($data['new']['document_root'],false);
                $app->system->rename($data['new']['document_root'],$data['new']['document_root'].'_bak_'.date('Y_m_d_H_i_s'));
                $app->log('Renaming existing directory in new docroot location. mv '.$data['new']['document_root'].' '.$data['new']['document_root'].'_bak_'.date('Y_m_d_H_i_s'),LOGLEVEL_DEBUG);
            }
            
            //* Create new base directory, if it does not exist yet
            if(!is_dir($new_dir)) $app->system->mkdirpath($new_dir);
            $app->system->web_folder_protection($data['old']['document_root'],false);
            exec('mv '.escapeshellarg($data['old']['document_root']).' '.escapeshellarg($new_dir));
            //$app->system->rename($data['old']['document_root'],$new_dir);
            $app->log('Moving site to new document root: mv '.$data['old']['document_root'].' '.$new_dir,LOGLEVEL_DEBUG);
server/plugins-available/nginx_plugin.inc.php
@@ -446,12 +446,14 @@
            //* Check if there is already some data in the new docroot and rename it as we need a clean path to move the existing site to the new path
            if(@is_dir($data['new']['document_root'])) {
                $app->system->rename($data['new']['document_root'],$data['new']['document_root'].'_bak_'.date('Y_m_d'));
                $app->log('Renaming existing directory in new docroot location. mv '.$data['new']['document_root'].' '.$data['new']['document_root'].'_bak_'.date('Y_m_d'),LOGLEVEL_DEBUG);
                $app->system->web_folder_protection($data['new']['document_root'],false);
                $app->system->rename($data['new']['document_root'],$data['new']['document_root'].'_bak_'.date('Y_m_d_H_i_s'));
                $app->log('Renaming existing directory in new docroot location. mv '.$data['new']['document_root'].' '.$data['new']['document_root'].'_bak_'.date('Y_m_d_H_i_s'),LOGLEVEL_DEBUG);
            }
            
            //* Create new base directory, if it does not exist yet
            if(!is_dir($new_dir)) $app->system->mkdirpath($new_dir);
            $app->system->web_folder_protection($data['old']['document_root'],false);
            exec('mv '.escapeshellarg($data['old']['document_root']).' '.escapeshellarg($new_dir));
            //$app->system->rename($data['old']['document_root'],$new_dir);
            $app->log('Moving site to new document root: mv '.$data['old']['document_root'].' '.$new_dir,LOGLEVEL_DEBUG);