$ curl https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo apt-key add -
$ sudo apt install curl (if curl not installed)
$ sudo sh -c 'echo "deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/focal pgadmin4 main" > /etc/apt/sources.list.d/pgadmin4.list'
$ sudo apt update
$ sudo apt install pgadmin4
Configure pgAdmin4-Web
$ sudo /usr/pgadmin4/bin/setup-web.sh
After Installed Navigate to your browser
Database Backup:
Here I will take a backup using PG Admin 4.
This is for those who have already installed pgAdmin4 in the system.
Log in
Once log in it will again ask for your database password
Once you hit backup it will show this
Once when it is succesfully backed up
Download the file and save it
Restoring Dspace database from older version to new version
$ sudo /etc/init.d/postgresql restart
$ sudo -u postgres psql
Step 6: Drop and create new database and assign ownership
DROP DATABASE dspace;
CREATE DATABASE dspace;
ALTER ROLE dspace WITH PASSWORD 'library';
ALTER DATABASE dspace OWNER TO dspace;
GRANT ALL PRIVILEGES ON DATABASE dspace TO dspace;
Change the database\c dspaceCREATE EXTENSION pgcrypto;See tables\dt \q----------------------Restoring the Database . Assuming that your database in in Downloads$ sudo su postgres$ cd Downloads----------ErrorUse the pg_restore command-line client to restore this dump to a database.pg_restore -d dspace dspace1.sql postgres@iitgn-OptiPlex-9010:/home/iitgn/Downloads$ pg_restore -d dspace dspace1.sql ORErrorpg_restore: error: input file appears to be a text format dump. Please use psql.psql -F dspace <dspace1.sqlpostgres@iitgn-OptiPlex-9010:/home/iitgn/Downloads$ psql -F dspace <dspace1.sqlORRestoring from a pg-dump filepg_dump dspace > dspace.backuppostgres@iitgn-OptiPlex-9010:/home/iitgn/Downloads$ pg_dump dspace > dspace.backup$ exitStep 7 - Check your database information
$ sudo /dspace/bin/dspace database info
Step 8 - Migrate your Database
$ sudo /dspace/bin/dspace database migrate
Step 8 - Change your directory to Dspace
$ su dspace
$ psql -U dspace -f /dspace/etc/postgres/update-sequences.sql (find the file update-sequences.sql )
If it gives error like this
psql:D:/DSPACE.5.6.n/DSPACE/etc/postgres/update-sequences.sql:63: ERROR: relation "handle_id_seq" does not exist
LINE 1: SELECT setval('handle_id_seq', max(handle_id)) FROM handle;
$ exit and go to root user
# As of 6.4, this script can instead be run via
[dspace]/bin/dspace update-sequences
# For 6.3 and below, you have to run this via database tools
# General PostgreSQL example
psql -U [database-user] -f [dspace]/etc/postgres/update-sequences.sql [database-name]
# Example for a PostgreSQL database named "dspace", and a user account named "dspace"
# psql -U dspace -f [dspace]/etc/postgres/update-sequences.sql dspace
$ sudo /dspace/bin/dspace database status (Check that database migration is not pending. It should not show any pending left in database migrate)
After database migration successful
$ su dspace
$ psql -U dspace -f /dspace/etc/postgres/update-sequences.sql (find the file update-sequences.sql )
Step 9 - Index Discovery
$ sudo /dspace/bin/dspace index-discovery -b
Step 10 - Filter Media
$ sudo /dspace/bin/dspace filter-media
It might likely give an error saying solr refused connection when you don't start your tomcat. So if you get any error start your tomcat.
Step 11 - Index Discovery
$ sudo /dspace/bin/dspace index-discovery
Step 12 - Optimize indexing
$ sudo /dspace/bin/dspace index-discovery -o
Re-Start Tomcat
$ sudo service tomcat restart
Navigate to your browser
http://127.0.1.1:8080/xmlui