Can some-one tell me the best and easiest way to go about backing up the MySQL test link data.
We are running version 1.7.4
Test link Backup
Moderators: Amaradana, TurboPT, TL Developers
Check the article: http://www.teamst.org/index.php?option= ... 5&Itemid=2
-
- TestLink user
- Posts: 1
- Joined: Thu Dec 18, 2008 9:27 am
Hi
You can use the following PHP script.
#################################################
<?php
$host = "localhost";
$database = "<DBName>";
$user = "<User Name>";
$pass = "<Password>";
$dbh = mysql_connect($host, $user, $pass) or die ("Can't connect to MySQL");
mysql_select_db($database) or die ("Can't connect to db");
$bckp_file = $database.date("Y-m-d-H-i-s").".sql";
$command = "mysqldump -h$host -u$user -p$pass $database > $bckp_file";
$database > $bckp_file;
system ($command);
?>
##########################################################
You need to only change the Database name, User Name and Password in this script.
Command for running this script:-
For Windows:-
C:\path\to\php.exe -f c:\path\to\script
For Linux:-
/path/to/php -f /path/to/script
For automatic execution of this script, use the "at" command from command line.
#################################################
<?php
$host = "localhost";
$database = "<DBName>";
$user = "<User Name>";
$pass = "<Password>";
$dbh = mysql_connect($host, $user, $pass) or die ("Can't connect to MySQL");
mysql_select_db($database) or die ("Can't connect to db");
$bckp_file = $database.date("Y-m-d-H-i-s").".sql";
$command = "mysqldump -h$host -u$user -p$pass $database > $bckp_file";
$database > $bckp_file;
system ($command);
?>
##########################################################
You need to only change the Database name, User Name and Password in this script.
Command for running this script:-
For Windows:-
C:\path\to\php.exe -f c:\path\to\script
For Linux:-
/path/to/php -f /path/to/script
For automatic execution of this script, use the "at" command from command line.