cancel
Showing results for 
Search instead for 
Did you mean: 

Restore Alfresco Database (PostgreSQL)

ddtien66
Champ on-the-rise
Champ on-the-rise

Hi all,

 Due to a server crash, I have to restore the whole Alfresco Community (ver 5.2). I am trying to follow the guide in https://community.alfresco.com/thread/202783-backup-and-restore-procedures , but get stuck at recovery of Postgres database, since I cannot login with 'postgres' account (mine PostgreSQL is running on Centos 7). Which is the default password of 'postgres' user? anyone who knows, please help me. I am much appreciated!

Tien

1 ACCEPTED ANSWER

4535992
Star Collaborator
Star Collaborator

Try this with root privileges:

Enter with postgres user

su - postgres

Go to the directory

cd /opt/alfresco-community/postgresql/bin/

Run bin

./psql

Insert the password (usually on the alfresco-global-properties)

> YOUR_SQL_COMMAND

>\q

Exit from postgres user

exit

If you want just do a dump then

su - postgres

cd /opt/alfresco-community/postgresql/bin/

./pg_dump -h 127.0.0.1 -U alfresco -W alfresco > /opt/alfresco/alfresco52dump.sql

for restore

./psql -h 127.0.0.1 -U alfresco -W alfresco < /opt/alfresco/alfresco52dump.sql

View answer in original post

3 REPLIES 3

4535992
Star Collaborator
Star Collaborator

Try this with root privileges:

Enter with postgres user

su - postgres

Go to the directory

cd /opt/alfresco-community/postgresql/bin/

Run bin

./psql

Insert the password (usually on the alfresco-global-properties)

> YOUR_SQL_COMMAND

>\q

Exit from postgres user

exit

If you want just do a dump then

su - postgres

cd /opt/alfresco-community/postgresql/bin/

./pg_dump -h 127.0.0.1 -U alfresco -W alfresco > /opt/alfresco/alfresco52dump.sql

for restore

./psql -h 127.0.0.1 -U alfresco -W alfresco < /opt/alfresco/alfresco52dump.sql

ddtien66
Champ on-the-rise
Champ on-the-rise

Thanks a lot. It works fantastically!

4535992
Star Collaborator
Star Collaborator

Mark as Corrected Answer then