Thursday, June 2, 2016

Restore old versions of Dspace to Dspace 5

Restoration of old versions of Dspace to version 5.x is comparatively easy now.

Take backup of old Dspace database

Open a Terminal and apply following commands,

sudo su
pg_dump -U dspace -h localhost -Fc dspace > dspace.pgsql

Enter the password of Linux user dspace.

Copy database backup, assetstore and log folders of old dspace.

Install latest Dspace version.
Follow the below steps to restore old Dspace backup.

Stop Postgre Service

/etc/init.d/postgresql stop
/etc/init.d/postgresql start

Remove asset store and log folders

rm -rf /dspace/assetstore
rm -rf /dspace/log/

Move your old assetstore and log folders to /dspace folder.

mv assetstore /dspace
mv log /dspace

Restoration of database

su -l dspace
dropdb -U dspace dspace
createdb -U dspace -E UNICODE dspace
pg_restore -d dspace < /home/dspace/dspace.pgsql

[Replace DB username,name and backup destination]

exit

Apply following commands

/dspace/bin/dspace database info
/dspace/bin/dspace database migrate
/dspace/bin/dspace index-discovery -b
/dspace/bin/dspace filter-media
/dspace/bin/dspace index-discovery
/dspace/bin/dspace index-discovery -o
/etc/init.d/tomcat7 restart

2 comments:

  1. su -dspace no lo reconoce y el psql da lo siguiente:
    psql: could not connect to server: No existe el archivo o el directorio
    Is the server running locally and accepting
    connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

    Lo instale siguiendo las otras instrucciones, ahora quiero migrar la base de datos vieja..

    ReplyDelete
  2. Dear Vimal Ji,
    I have a dspace 4.2 repository. It is installed as per your dspace 4.2 guide line. Now i want to update to 5.x. Pl. instruct me. I tried with the above one but unable to succeed.
    regards

    ReplyDelete