dspace.backup (Database backup)
assetstore (All uploaded files for e.g, pdf, image,etc..)
log (Configuration files)
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.
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
Restoration of backup to the latest version of Dspace Install latest Dspace.
see https://gist.github.com/kendrickjr/f2d17cf504131391a17e4e1803864e65
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
sudo /dspace/bin/dspace database migrate
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
sudo /dspace/bin/dspace index-discovery (Index update)
sudo /dspace/bin/dspace index-discovery -o
sudo service tomcat start
Open DSpace in a browser