Backup and Restore of old Dspace to New Dspace versions.

1. Below are three essential backups to take in dspace.

1.dspace.backup (Database backup)

2.assetstore  (All uploaded files for e.g, pdf, image,etc..)

3 . log  (Configuration files) 

Step - 1

2. Take a backup of Dspace database.

Assume that the old version of Dspace is running. Take a PostgreSQL database backup. 

Open a Terminal and apply following commands, 

sudo su - postgres
pg_dump dspace > dspace.backup

The above command take a backup of Dspace database and store in /var/lib/postgresql/ 

Copy the database backup file to a safe place.

Step - 2

3. Take a backup assetstore and log folders.

Here we are going to backup essential things. All uploaded files stored in assetstore folder.

Save the assetstore and log files to External hard disc. (below red color command your external hard disc storage location)

cd /media/your pc name/External hard disc name
sudo zip -r assetstore.zip /dspace/assetstore
sudo zip -r log.zip /dspace/log

Step - 3

4. Restoration of backup to the latest version of Dspace

  • Install latest Dspace. 
  • Copy the assetstore, log folders, and database.backup to home folder of the system.
  • Extract (unzip) the assetstore and log folders. 
  • Follow the below steps to restore old Dspace backup.

Stop Tomcat server

sudo service tomcat stop

Remove the new dspace assetstore and log folders.

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

Move the old dspace assetstore and log folders.

Move your old assetstore and log folders to /dspace folder. (Copy & paste the assetstore and log folder in Home folder)

sudo mv /home/assetstore /dspace
sudo mv /home/log /dspace

Restoration of database

sudo systemctl stop postgresql
sudo systemctl start postgresql

Drop the database and create a new one. 

Apply following commands one by one,
sudo -u postgres psql
DROP DATABASE dspace;
CREATE DATABASE dspace;
\quit

Restore the data base backup

Make sure that the dspace.backup file in home folder. 
Apply the following command one by one to restore the database backup
sudo su postgres
psql -f dspace.backup dspace
exit

Install pgcrypto postgres extension

Execute the following commands one by one,
sudo su postgres
psql --username=postgres dspace -c "CREATE EXTENSION pgcrypto;"
exit

Apply following commands

(Dspace database version check)
sudo /dspace/bin/dspace database info
(Upgrade old database to new database migration)
sudo /dspace/bin/dspace database migrate

(Index Created)

sudo /dspace/bin/dspace index-discovery -b

(All types of files configuration process, for E.g pdf, image, video, audio and etc.. this command long process)

sudo /dspace/bin/dspace filter-media
(Index configuration)
sudo /dspace/bin/dspace index-discovery

 (Index update)

sudo /dspace/bin/dspace index-discovery -o

Restart Tomcat

sudo service tomcat start

Open DSpace in a browser
http://127.0.1.1:8080/jspui

http://127.0.1.1:8080/xmlui


Information courtesy
http://dspacegeek.blogspot.com/2016/06/restore-old-versions-of-dspace-to.html



Post a Comment

8 Comments

  1. IBPS PO Prelims Admit Card 2023

    ReplyDelete
  2. That is awesome post. Helpful for new people. thank you

    ReplyDelete
  3. We are at Softwareandappdeveloper Acquire the latest technology news, gadgets news, and gaming news on GadzetDekho. Search latest mobile phones, laptops, wearables, smart TVs price, reviews

    ReplyDelete
  4. hey, after using the guide, i am getting an error while downloading the items

    ReplyDelete