Take a backup of Dspace database and folders
Assume
that the old version of Dspace is running. Take a PostgreSQL database backup.
Open a Terminal (Ctrl+Alt+t) and apply following commands,
sudo su - postgres
pg_dump dspace > dspace.backup
The above command take a backup of Dspace database and store in path of /Computer/var/lib/postgresql/ . Copy the database.backup file to a safe place.
Copy
assetstore and log folders
Here we are going to backup essential things. All uploaded files
stored in assetstore folder.
sudo zip -r assetstore.zip /dspace/assetstore
sudo zip -r log.zip /dspace/log
sudo zip -r assetstore.zip /dspace/assetstore
sudo zip -r log.zip /dspace/log
After applying the command
two zip files will be created in home folder (Locked files), unlock (change the
file permission) the file by applying following command
sudo chmod -R 777
assetstore.zip
sudo chmod -R 777 log.zip
Restoration
of backup to the latest version of Dspace
Install latest Dspace version. Copy the assetstore, log folders, and database backup (database.backup) to home folder of the system. Extract the assetstore and log folders. Follow the below steps to restore old Dspace backup.
Change permissions and delete
the assetstore & log folder (If the folders are locked, unlock by the following
command)
sudo chmod -R 777
/dspace/assetstore
sudo chmod -R 777
/dspace/log
Stop
Tomcat server (following command works with patch file stored in home
folder)
Sh start_server.sh
(O for stop, 1 for start)
Copy and paste
assetstore and log folders to /dspace folder (Change permissions if folders are
locked, unlock by using following command)
sudo chmod -R 777
/dspace/assetstore
sudo chmod -R 777
/dspace/log
Restoration
of database
Restart PostgreSQL
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
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
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
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
Install pgcrypto postgres extension- Execute the following
commands one by one,
Make sure that you are in sudo
su postgres prompt
tomcat has to be stopped
psql --username=postgres dspace -c "CREATE EXTENSION pgcrypto;"
exit
Apply following commands in
admin shell prompt (not in postgresql prompt)
sudo /dspace/bin/dspace database info
sudo /dspace/bin/dspace database migrate
sudo /dspace/bin/dspace index-discovery -b
sudo /dspace/bin/dspace filter-media
sudo /dspace/bin/dspace index-discovery
sudo /dspace/bin/dspace index-discovery -o
sudo /dspace/bin/dspace database info
sudo /dspace/bin/dspace database migrate
sudo /dspace/bin/dspace index-discovery -b
sudo /dspace/bin/dspace filter-media
sudo /dspace/bin/dspace index-discovery
sudo /dspace/bin/dspace index-discovery -o
Restart
Tomcat (following command works with patch file stored in home
folder)
Sh start_server.sh
Press 1 to start
Open
DSpace in a browser
http://localhost:8080/jspui
Compiled by: Prof. Subramanya R A, Dept. of MCA, Maharaja Institute of Technology Mysore.
Reference: