From 7f702ab67f1fc14436b21fc8727180b065aeaa4b Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Thu, 13 Nov 2008 11:35:54 -0500
Subject: [PATCH] The update script creates now a database backup in the root folder.

---
 install/update.php |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/install/update.php b/install/update.php
index 3200a6d..d2b4c01 100644
--- a/install/update.php
+++ b/install/update.php
@@ -143,6 +143,13 @@
 	system("mysql -h ".$conf['mysql']['host']." -u ".$conf['mysql']['admin_user']." ".$conf['mysql']['database']." < 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').'.sql';
+copy('existing_db.sql',$backup_db_name);
+exec("chmod 700 $backup_db_name");
+exec("chown root:root $backup_db_name");
+
+
 //** Update server ini
 $tmp_server_rec = $inst->db->queryOneRecord("SELECT config FROM server WHERE server_id = ".$conf['server_id']);
 $old_ini_array = ini_to_array(stripslashes($tmp_server_rec['config']));

--
Gitblit v1.9.1