Problems restoring backup to new installation

Moderator: crythias

Post Reply
facundocaballe
Znuny newbie
Posts: 12
Joined: 27 Mar 2017, 22:07
Znuny Version: OTRS5
Real Name: Facundo Caballe
Company: Yagmour

Problems restoring backup to new installation

Post by facundocaballe »

Hi all.

I made a new server for OTRS. Centos 7.

Install the entire system and it works. The previous server was configured by someone else, and has no documentation of it.
I backed up that environment, and now I try to restore it to the new server.
But I have this error when I am running the restore.pl command:

Code: Select all

Restore /var/backups/OTRS/2017-05-09_02-00//Config.tar.gz ...
[Tue May  9 15:04:27 2017] restore.pl: DBI connect('database=XXX;host=127.0.0.1','IT',...) failed: Access denied for user 'IT'@'localhost' (using password: YES) at /opt/otrs/Kernel/System/DB.pm line 202.
ERROR: OTRS-restore.pl-01 Perl: 5.16.3 OS: linux Time: Tue May  9 15:04:27 2017

 Message: Access denied for user 'IT'@'localhost' (using password: YES)

 Traceback (52088): 
   Module: Kernel::System::DB::Prepare Line: 666
   Module: /opt/otrs/scripts/restore.pl Line: 121

Can't call method "fetchrow_array" on an undefined value at /opt/otrs/Kernel/System/DB.pm line 746.
I created the user "IT" in my new DB, and granted the corresponding permissions. But he still threw me the same message.
I can not find, where is that embedded user, and password, in order to change it.

Can you help me?

Thanks in advanced.
Best Regard.
Facundo
Rikimaru
Znuny newbie
Posts: 21
Joined: 04 Jul 2017, 12:11
Znuny Version: 6.3.3
Real Name: Daniel

Re: Problems restoring backup to new installation

Post by Rikimaru »

Hi facundocaballe,

i had the same issue yesterday and the solution seems to missing in the official docs. You have to change
the db-password to the one, you have used for the db which is contained in your backup.

You can do this directly in the "empty new created db" .

The command was :

mysql -u root -p ( Starts mysql )

SET PASSWORD FOR 'user-name-here'@'hostname-name-here' = PASSWORD('new-password-here');

For the 'new-password-here' you have to use the one from your old db.

Example :
SET PASSWORD FOR 'otrs'@'localhost' = PASSWORD('pAsSWord');


That solved my issue :)
RStraub
Znuny guru
Posts: 2210
Joined: 13 Mar 2014, 09:16
Znuny Version: 6.0.14
Real Name: Rolf Straub

Re: Problems restoring backup to new installation

Post by RStraub »

The reason for this is, the restore script first restores the configuration files (like Config.pm, which contains the DB-Access parameters). THEN it uses those to connect to the DB to restore the data.
Currently using: OTRS 6.0.14 -- MariaDB -- Ubuntu 16 LTS
Post Reply