From 186781a22d8df7f05f6a1c868b78bba24f35b8ed Mon Sep 17 00:00:00 2001 From: lissav Date: Sun, 6 Feb 2011 13:05:19 +0000 Subject: [PATCH] allow migration between databases git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@8796 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-client/bin/db2sqlsetup | 9 ++++++++- xCAT-client/bin/mysqlsetup | 1 - 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/xCAT-client/bin/db2sqlsetup b/xCAT-client/bin/db2sqlsetup index 1d909df42..af864b021 100755 --- a/xCAT-client/bin/db2sqlsetup +++ b/xCAT-client/bin/db2sqlsetup @@ -1471,6 +1471,13 @@ sub createcfgloc sub restorexcatdb { + # set the env variable for Table.pm for the new database + my $xcatcfg; + my $cfgl; + open($cfgl,"<","/etc/xcat/cfgloc"); + $xcatcfg = <$cfgl>; + close($cfgl); + chomp($xcatcfg); # restore the database xCAT::MsgUtils->message( @@ -1485,7 +1492,7 @@ sub restorexcatdb } # restore it - my $cmd = "XCATBYPASS=1 restorexCATdb -p $::backupdir"; + my $cmd = "XCATBYPASS=1 XCATCFG=\"$xcatcfg\" restorexCATdb -p $::backupdir"; xCAT::Utils->runcmd($cmd, 0); if ($::RUNCMD_RC != 0) { diff --git a/xCAT-client/bin/mysqlsetup b/xCAT-client/bin/mysqlsetup index 364c7e166..2ccb49c6a 100755 --- a/xCAT-client/bin/mysqlsetup +++ b/xCAT-client/bin/mysqlsetup @@ -1664,7 +1664,6 @@ sub restorexcatdb $xcatcfg = <$cfgl>; close($cfgl); chomp($xcatcfg); - $ENV{'XCATCFG'}=$xcatcfg; # restore the database xCAT::MsgUtils->message(