Test link Backup

Discuss test processes, standards, documentation, teams, criteria, test environments, etc.

Moderators: Amaradana, TurboPT, TL Developers

Post Reply
Rhoades
TestLink user
Posts: 2
Joined: Tue Nov 11, 2008 9:17 am

Test link Backup

Post by Rhoades »

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
havlatm
Member of TestLink Community
Posts: 940
Joined: Mon Oct 31, 2005 1:24 am
Location: Czech

Post by havlatm »

gauravkkumar
TestLink user
Posts: 1
Joined: Thu Dec 18, 2008 9:27 am

Hi

Post by gauravkkumar »

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.
Post Reply