Backing up Clearspace

    You should regularly backup backup the Clearspace database and the jiveHome directory, especially before performing a Clearspace upgrade.


    Linux with MySQL


    If you've created a clearspace user that resides at /usr/local/clearspace, we recommend creating the following directories:


     |-- backups/
     |-- deployments/
     |-- jiveHome


    The backups directory will contain backups of the database and jiveHome directory. The deployments directory will contain exploded WAR files of Clearspace deployments (we recommend using a symbolic link to post to the "latest" deployment").


    The following shell script ( would live in the backups directory and backs up the database named "clearspace" using a database user named "clearspace". You must pass in the database password as an argument to the script:

    if [[ $# -ne 1 ]]; then
    echo "Usage: $0 <password>"
    exit 1
    echo "Backing up Clearspace database..."
    mysqldump --user=clearspace --password=$1 --max_allowed_packet=512MB clearspace | gzip > clearspace_db_$(date +%m-%d-%Y).dump.sql.gz
    echo "done backing up Database."
    echo "Making a copy of jiveHome"
    cp -R ../jiveHome ./jiveHome_$(date +%m-%d-%Y)
    echo "done copying jiveHome"
    You should edit the script to match your own environment. After the script is run, a tar.gz backup of the database (named with the current date) will be in the backups directory, along with a copy of the jiveHome directory (named with the current date).