Hi Mark,

> You can change that last record from "md5" (which requires a password) to
"trust"...

I did that.

Then I restarted postgresql-9.5, and ran the cammond as follows:

[root@dr data]# /usr/pgsql-9.5/bin/psql -U postgres -f
/dspace-backup/pg.out postgres

The output as following:

SET
SET
SET
CREATE ROLE
ALTER ROLE
psql:/dspace-backup/pg.out:16: ERROR:  role "postgres" already exists
ALTER ROLE
CREATE DATABASE
REVOKE
REVOKE
GRANT
GRANT
You are now connected to database "dspace" as user "postgres".
SET
SET
SET
SET
SET
SET
CREATE EXTENSION
COMMENT
...

ALTER TABLE
COPY 1710
 setval
--------
   1710
(1 row)
 ...



It keeps going like this, and the last several lines:

GRANT
You are now connected to database "template1" as user "postgres".
SET
SET
SET
SET
SET
SET
COMMENT
CREATE EXTENSION
COMMENT
REVOKE
REVOKE
GRANT
GRANT


Does that mean the restore is successful?


Thank you very much.




Yongming



On Fri, Nov 25, 2016 at 12:12 PM, Wang, Yongming <[email protected]> wrote:

> Mark,
>
> Thank you so much for your reply. I'm going to work on it on Monday.
>
>
> Yongming
>
> On Wed, Nov 23, 2016 at 1:28 PM, Mark Wood <[email protected]> wrote:
>
>> 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/doc
>> s/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/sup
>> port/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 Community" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at https://groups.google.com/group/dspace-community.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> Yongming Wang
> Systems Librarian/Associate Professor
> The College of New Jersey
> tel: 609-771-3337
> email: [email protected]
>



-- 
Yongming Wang
Systems Librarian/Associate Professor
The College of New Jersey
tel: 609-771-3337
email: [email protected]

-- 
You received this message because you are subscribed to the Google Groups 
"DSpace Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/dspace-community.
For more options, visit https://groups.google.com/d/optout.

Reply via email to