[Solved] Database location problem during update

Moderator: crythias

Post Reply
kkgigiioo
Znuny newbie
Posts: 22
Joined: 06 Mar 2019, 09:26
Znuny Version: 6.0.15

[Solved] Database location problem during update

Post by kkgigiioo »

Hello everyone!

I want to upgrade from OTRS 4.0.29 to 5.0.38. The database runs on a completely separate server from the system. When I try to run the database update command I get the following error:

Code: Select all

OTRSTest:~$ cat scripts/DBUpdate-to-5.postgresql.sql | psql --set ON_ERROR_STOP=on --single-transaction otrs otrs
	psql: could not connect to server: No such file or directory
        Is the server running locally and accepting
        connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
If I run the check command, then everything is good:

Code: Select all

OTRSTest:~$ bin/otrs.Console.pl Maint::Database::Check
Trying to connect to database 'DBI:Pg:dbname=otrs_teszt;host=myserever.local;port=5**;' with user 'otrs'...
Connection successful.

What could be the problem?

Please help!

Thank you in advance for your answers!

Regards!
Last edited by kkgigiioo on 25 Oct 2019, 09:04, edited 1 time in total.
root
Administrator
Posts: 3965
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: Database location problem during update

Post by root »

Hi,

psql is missing the proper hostname of the database server. Without the command is trying to connect via socket.

- Roy
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Use a test system - always.

Do you need professional services? Check out https://www.znuny.com/

Do you want to contribute or want to know where it goes ?
kkgigiioo
Znuny newbie
Posts: 22
Joined: 06 Mar 2019, 09:26
Znuny Version: 6.0.15

Re: Database location problem during update

Post by kkgigiioo »

Thanks for the quick response!
Can you explain a little bit goodly about what the problem is?
Unfortunately, I don't really understand what's really wrong.
fcasal
Znuny wizard
Posts: 336
Joined: 21 Apr 2014, 16:14
Znuny Version: 6.0.18

Re: Database location problem during update

Post by fcasal »

In the admin manual says that

TargetDatabaseHost => 192.168.137.20 (Here you need to enter the ip address of your target
system)
TargetDatabase => otrs
TargetDatabaseUser => otrs
TargetDatabasePw => I88cm34A1B6xrl3 (Here you need to set the password of your target
system)
TargetDatabaseType => postgresql

Check the manual for more info.
Last edited by fcasal on 25 Oct 2019, 13:06, edited 1 time in total.
kkgigiioo
Znuny newbie
Posts: 22
Joined: 06 Mar 2019, 09:26
Znuny Version: 6.0.15

Re: Database location problem during update

Post by kkgigiioo »

Thanks again for your help!

The problem has been resolved. I just copied the run command and it is parameterized so that the database runs locally as well. The command has already been executed after the parameterization.

My wrong command:

Code: Select all

cat scripts/DBUpdate-to-5.postgresql.sql | psql --set ON_ERROR_STOP=on --single-transaction otrs otrs
And the good command:

Code: Select all

cat scripts/DBUpdate-to-5.postgresql.sql | psql --set ON_ERROR_STOP=on --single-transaction -h my.databaseserver -d otrs_teszt -p 5** -U myotrsUser
Post Reply