On Wednesday, November 23, 2016 at 10:17:31 AM UTC-5, wangyo wrote:
>
> Dear all,
>
> One of the DSpace 6.0 pre-requisites is PostgreSQL 9.4 or above. My 
> current DSpace 5.1 installation has PostgreSQL 9.2. So I have to upgrade my 
> PostgreSQL first in order to upgrade to DSpace 6.0.  My OS is RHEL 7.
>
> I installed PostgreSQL 9.5 by using rpm and yum. The installed directory 
> is /usr/pgsql-9.5 (the default). My PostgreSQL 9.2 is at /usr/share/pgsql. 
>
> Before I installed PostgreSQL 9.5, I used pg_dumpall to backup the 
> PostgreSQL 9.2 to a file named pg.out. After I installed PostgreSQL 9.5, I 
> tried to restore my backup file by using psql like this:
>
> # /usr/pgsql-9.5/bin/psql -f /dspace-backup/pg.out postgres
> Password:
>
> I got the following error:
>
> psql: FATAL:  password authentication failed for user "root"
>
> I tried all different passwords, but the same error every time.
>
> What is the cause for this error? How do I solve it?
>

That command does not specify a database user, so psql assumes that the 
database user has the same name as the OS user who is running it.  From the 
prompt, I assume that this was done as 'root' so psql tried to login *to 
the database* as 'root', which is probably not a known database user.  The 
DBMS user may be specified by adding '-U USER or '--username=USER' (where 
USER is some known DBMS username), but on a freshly installed instance you 
probably don't have any way of knowing the only defined user's password.

If you run the same command as the OS user which runs the DBMS (probably 
some variant of 'postgres') then you would be assuming the identity of the 
DBMS superuser and should be able to restore the dump without a DBMS 
password.  Supposing the DBMS owner account to be 'postgres', I would (as 
root) 'su postgres' and run the command.  (The dump file must be readable 
by that account.)  You can probably accomplish the same using 'sudo' but I 
don't know its specifics.
 

> I did two things before doing the above restore procedure: 
>
> 1. Edit /var/lib/pgsql/data/9.5/postgresql.conf 
> Uncomment the line: listen_addresses = ‘localhost’
>
> 2. Edit /var/lib/pgsql/data/9.5/pg_hba.conf
> Add the line: host dspace dspace 127.0.0.1 255.255.255.255 md5
> Change: “local all all  peer” to “local all all  md5” 
>

You can change that last record from "md5" (which requires a password) to 
"trust" (which does not require any sort of authentication).  DO NOT LEAVE 
IT SET TO "trust" AFTER RESTORING THE DUMP.  You will need to restart the 
DBMS instance after changing the configuration.  You will still have to 
connect to the DBMS as a known user, and a freshly installed instance 
should have only one:  the DBMS superuser.  You would need to specify -U or 
--username=.

I recommend reading at least some of 
https://www.postgresql.org/docs/9.5/static/admin.html to learn the basics 
of running PostgreSQL.
 

> My other questions are: 
>
> Do I have to backup my PostgreSQL 9.2 and restore it to PostgreSQL 9.5?
>

That is the safest way to upgrade PostgreSQL.
 
 | Or rather, do I have to upgrade to PostgreSQL 9.4 or above?

 An older version of PostgreSQL *may* be sufficient, but DSpace has not 
been tested with it.  According to 
https://www.postgresql.org/support/versioning/ support for 9.2 will end in 
about ten months, so it is about time to upgrade anyway.

-- 
You received this message because you are subscribed to the Google Groups 
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dspace-tech+unsubscr...@googlegroups.com.
To post to this group, send email to dspace-tech@googlegroups.com.
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.

Reply via email to