SUNScholar/Rebuild DSpace/4X

Back to Rebuild Dspace

Step 1 - Login to your server
Check the following wiki page, and then return. http://wiki.lib.sun.ac.za/index.php/SUNScholar/Prepare_Ubuntu/S01

Step 2 - Create a scripts folder
Type the following: mkdir /home/dspace/scripts

Step 3 - Create the script
Type the following: nano /home/dspace/scripts/build-webapps

Copy and paste the following into the open nano editor.


 * 1) !/bin/bash

sudo service tomcat6 stop sleep 3


 * 1) Optional ####
 * 2) Remove old cache and log files. Uncomment below to enable.
 * 3) echo "Clean out old xmlui cache files"
 * 4) sudo rm /var/lib/tomcat6/work/Catalina/localhost/_/cache-dir/cocoon-ehcache.data
 * 5) sudo rm /var/lib/tomcat6/work/Catalina/localhost/_/cache-dir/cocoon-ehcache.index
 * 6) echo "Remove old catalina log file"
 * 7) sudo rm /var/log/tomcat6/catalina.out


 * 1) Optional ####
 * 2) Remove old webapps. Uncomment below to enable.
 * 3) echo "Clean out old webapps"
 * 4) sudo rm -rf /home/dspace/webapps/*


 * 1) Optional ####
 * 2) Remove old config folder. Uncomment below to enable.
 * 3) echo "Clean out old configs"
 * 4) sudo rm -rf /home/dspace/config/*

echo "Start MAVEN build" cd /home/dspace/source mvn -U clean package

echo "Start ANT updates" cd /home/dspace/source/dspace/target/dspace-XXX-build ant update


 * 1) Optional ####
 * 2) Clean backups. Uncomment below to enable.
 * 3) ant clean_backups


 * 1) Optional ####
 * 2) Overwrite configs. Uncomment below to enable.
 * 3) ant -Doverwrite=true update_configs


 * 1) Optional ####
 * 2) Geolite database updates.
 * 3) !!!! Your server should be open on the internet before you do this !!!!
 * 4) Uncomment below to enable.
 * 5) sudo ant update_geolite


 * 1) Optional ####
 * 2) Fix file and folder permissions. Uncomment below to enable.
 * 3) echo "Fixing file permissions. Please wait..."
 * 4) sudo chmod 0777 -R /home/dspace/config
 * 5) sudo chmod 0777 -R /home/dspace/log
 * 6) echo "Fixing file ownership. Please wait..."
 * 7) sudo chown dspace.tomcat6 -R /home/dspace/config
 * 8) sudo chown dspace.tomcat6 -R /home/dspace/log

sleep 3 sudo service tomcat6 restart

echo "Rebuild complete."

Step 4 - Make the script executable
Type the following: chmod 0755 $HOME/scripts/build-webapps

Step 5 - Run the script
Now you can rebuild DSpace WHEN NEEDED by simply typing the following; $HOME/scripts/build-webapps ''' After the rebuild check that the config files have been copied over from the source folder correctly. '''