| | |
| | | //if(filesize('existing_db.sql') < 30000) die('Possible problem with dumping the database. We will stop here. Please check the file existing_db.sql'); |
| | | |
| | | // create a backup copy of the ispconfig database in the root folder |
| | | $backup_db_name = '/root/ispconfig_db_backup_'.@date('Y-m-d_h-i').'.sql'; |
| | | if(isset($conf['backup_path'])) { |
| | | $backup_db_name = $conf['backup_path'].'/ispconfig_db_backup.sql'; |
| | | } else { |
| | | $backup_db_name = '/root/ispconfig_db_backup_'.@date('Y-m-d_H-i').'.sql'; |
| | | } |
| | | copy('existing_db.sql',$backup_db_name); |
| | | chmod($backup_db_name, 0700); |
| | | chown($backup_db_name, 'root'); |
| | |
| | | |
| | | //* update the database version in server table |
| | | $inst->db->query("UPDATE ".$conf["mysql"]["database"].".server SET dbversion = '".$current_db_version."' WHERE server_id = ".$conf['server_id']); |
| | | if($inst->db->dbHost != $inst->dbmaster->dbHost) $inst->dbmaster->query("UPDATE ".$conf["mysql"]["master_database"].".server SET dbversion = '".$current_db_version."' WHERE server_id = ".$conf['server_id']); |
| | | |
| | | |
| | | //* If ISPConfig Version < 3.0.3, we will do a full db update |
| | |
| | | |
| | | //* update the database version in server table |
| | | $inst->db->query("UPDATE ".$conf["mysql"]["database"].".server SET dbversion = '".$current_db_version."' WHERE server_id = ".$conf['server_id']); |
| | | if($inst->db->dbHost != $inst->dbmaster->dbHost) $inst->dbmaster->query("UPDATE ".$conf["mysql"]["master_database"].".server SET dbversion = '".$current_db_version."' WHERE server_id = ".$conf['server_id']); |
| | | |
| | | if ($conf['powerdns']['installed']) { |
| | | |
| | |
| | | $tpl_ini_array['global']['webserver'] = 'nginx'; |
| | | } |
| | | |
| | | // update the new template with the old values |
| | | //* update the new template with the old values |
| | | if(is_array($old_ini_array)) { |
| | | foreach($old_ini_array as $tmp_section_name => $tmp_section_content) { |
| | | foreach($tmp_section_content as $tmp_var_name => $tmp_var_content) { |
| | |
| | | $new_ini = array_to_ini($tpl_ini_array); |
| | | $sql = "UPDATE ".$conf["mysql"]["database"].".server SET config = '".mysql_real_escape_string($new_ini)."' WHERE server_id = ".$conf['server_id']; |
| | | $inst->db->query($sql); |
| | | |
| | | if($inst->db->dbHost != $inst->dbmaster->dbHost) { |
| | | $sql = "UPDATE ".$conf["mysql"]["master_database"].".server SET config = '".mysql_real_escape_string($new_ini)."' WHERE server_id = ".$conf['server_id']; |
| | | $inst->dbmaster->query($sql); |
| | | } |
| | | unset($old_ini_array); |
| | | unset($tpl_ini_array); |
| | | unset($new_ini); |