Skip to content

Commit 7f702ab

Browse files
committed
The update script creates now a database backup in the root folder.
1 parent 12ea25f commit 7f702ab

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

install/update.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,13 @@
143143
system("mysql -h ".$conf['mysql']['host']." -u ".$conf['mysql']['admin_user']." ".$conf['mysql']['database']." < existing_db.sql");
144144
}
145145

146+
// create a backup copy of the ispconfig database in the root folder
147+
$backup_db_name = '/root/ispconfig_db_backup_'.date('Y-m-d').'.sql';
148+
copy('existing_db.sql',$backup_db_name);
149+
exec("chmod 700 $backup_db_name");
150+
exec("chown root:root $backup_db_name");
151+
152+
146153
//** Update server ini
147154
$tmp_server_rec = $inst->db->queryOneRecord("SELECT config FROM server WHERE server_id = ".$conf['server_id']);
148155
$old_ini_array = ini_to_array(stripslashes($tmp_server_rec['config']));

0 commit comments

Comments
 (0)