Wednesday, May 8, 2024

Add a new item type in item submission page in DSpace 7

Open the following file in a terminal:

sudo mousepad /dspace/config/input-forms.xml

Find the lines for item types.


Copy an existing code for an item type.

<pair>
       <displayed-value>Animation</displayed-value>
       <stored-value>Animation</stored-value>
</pair>

Add new value and paste between any default item types.

<pair>
       <displayed-value>PhD Theses</displayed-value>
       <stored-value>PhD Theses</stored-value>
</pair> 

Save and close the file.
Restart Tomcat and refresh the page to see the change.

sudo systemctl restart tomcat9.service

Tuesday, January 16, 2024

Change the text at DSpace 7 home page


Frontpage template available at [dspace-angular-frontend]\src\themes\dspace\app\home-page\home-news\home-news.component.html. The location of the dspace-angular-dspace may vary.

Open the template file using a text editor like Nano, e.g.

sudo nano /home/dspace/dspace-angular-dspace-7.6.1/src/themes/dspace/app/home-page/home-news/home-news.component.html 

Rebuild the production environment to take effect the changes.

Enter the location of the dspace-angular-dspace. Find the exact location of the [dspace-angular-frontend] and apply the following command. Here is an example of the command,

cd /home/dspace/dspace-angular-dspace-7.6.1/config

Apply the following command

yarn run build:prod

Refresh the home page of DSpace to see the changes made.

Thursday, February 23, 2023

Automate DSpace backups with Cron Task

Database backup

Open a Terminal and log in as a Postgres user,

sudo su - postgres

Create a directory in the Postgres user’s home to store the backups. Apply the following command,

mkdir -p ~/backups

Enter into the crontab:

crontab -e

Add the following entry into the Cron,

#DSpace Postgres backup

10 20 * * * pg_dump -U postgres dbname > ~/postgres/backups/dbname-$(date +%d-%m-%Y-%H.%M).bak

Change the timing of the backup, here backup take at 8:10 PM

Apply  CTRL + O button to save the cron entry.
Then apply CTRL + X to exit from the cron. 

Type exit to exit from Postgres prompt.

Backup of asset store and log folders


Open a terminal and apply the following command to create a folder in Home to hold asset store and log folders.

sudo mkdir dspacebkup

Open crontab to add the entry to automate the folder backup,
sudo su
crontab -e

Add the following lines,

10 20 * * * zip -r /home/vimal/dspacebkup/assetstore-$(date +%d-%m-%Y-%H.%M).zip /dspace/assetstore
10 20 * * * zip -r /home/vimal/dspacebkup/log-$(date +%d-%m-%Y-%H.%M).zip /dspace/log

Change the path based on your local setup.

Saturday, February 4, 2023

Error 500-Service unavailable: how to solve

Many DSpace users got Error 500. To solve the error, check the following things one by one.

Solr

Apply the following commands to restart Solr.

su dspace
/opt/solr/bin/solr start
exit

Tomcat

Apply the following command restart Tomcat

sudo systemctl restart tomcat9.service

Start the user interface

Apply the following commands,

sudo su
pm2 start /home/dspace/dspace-angular-dspace-7.4/dspace-ui.json

Make available DSpace 7 in a local network / web

DSpace 7 default port for the front end is 4000. The port needs to open to make DSpace available in a local network. I applied this method on Ubuntu 22.04 and Debian 11. Here are the processes to make available DSpace 7 in the network. 

Open the Port 4000

ufw is the default firewall configuration tool. Install ufw by applying the following command,
 
sudo apt install ufw
 
Apply the following command to open port 4000.

sudo ufw allow 4000
sudo ufw enable 

Network configuration for DSpace

Find the IP address of the computer where DSpace is installed. Apply the following commands to install net-tools software in Ubuntu and know the network details.
 
sudo apt install net-tools 
ifconfig 

Debian users can apply the following command to know the network details,

nmcli -p device show

Note down the details and add the IP address. 
Open the DSpace configuration file, 

sudo mousepad /dspace/config/local.cfg 

Find the following lines and add the IP address/domain name instead of localhost.

dspace.ui.url = http://localhost:4000 
dspace.server.url = http://localhost:8080/server 


Save and close the file. 
Open the following configuration file (make sure the location of the file in your server) of the DSpace front end, 

sudo mousepad /home/dspace/dspace-angular-dspace-7.6.1/config/config.prod.yml

Find the following piece of lines, 

ssl: false 
host: localhost 
port: 4000 

Change the hostname. Change localhost to the IP address / domain name.

ssl: false 
host: your-ip-address
port: 4000 


Save and close the file.

Change localhost to the IP address. Save and close the file.
 
Restart PC. Try to load DSpace 7 from other PC in the network. Example, http://192.168.1.20:4000


References

Monday, December 12, 2022

Upgrading DSpace 6 to 7

Take a backup of the DSpace 6 database and folders

Open a Terminal and apply the following commands,

sudo su - postgres
pg_dump dspace > dspace.backup


The above command takes a backup of the DSpace database and stores in /var/lib/postgresql. Copy the database.backup file to a safe place.

Saturday, December 3, 2022

Install DSpace 7 on Debian 11 / Ubuntu 22.04 LTS

We use Debian 11 (Bull Eye) Xubuntu 22.04 LTS to install DSpace 7. ISO file of Debian 11 can be downloaded from the link (I prefer Debian with MATE desktop). Xubuntu 22.04 can be downloaded from here. Users who feel challenged to use barebone Debian can also try Dbebian-based Linux operating systems like Pepper Mint OSEither burn the ISO file to a pen drive or DVD. Install Debian 11 on the machine. Create a user account during the installation (e.g. mgu). Create the user with the name dspace after installing the Linux-based operating system. If you have already run on Ubuntu/Debian (e.g. for Koha), create a dspace user.

Prepare the system for Dspace installation.

DSpace consists of both a Java-based backend and an Angular-based front end. Both the backend and front end need to be installed separately. Install the prerequisites for the Dspace software. Dspace builds on the Java platform and requires software packages like Tomcat, Solr, Maven, Ant, etc.