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(