Backup

From Projectivity Documentation

Jump to: navigation, search
Go back to Administration section

Contents

Warning

Regular Data backups are essential administration tasks to avoid data loss. Always make a backup before updating your Projectivity environment.

If you run Projectivity in a mission critical environment you should consider Projectivity Certified Virtual Machine that includes an advanced administration console that, among other features, seamlessly allow data backup/restore.

How to backup

Projectivity stores data in 4 data-stores:

  1. PostgreSQL Data base: relational data
  2. Subversion: Documents Repositories
  3. Workspaces Lucene indexex
  4. Documents Lucene index


Also you need to backup your properties files and templates:

  • Projectivity Property file
  • Framework properties
  • Email and Report Templates


In order to backup your system you should first stop Projectivity and then backup the data stores. Refer to the following table to backup all needed datastores:


data store how to backup notes
DB use PostgreSQL pg_dump utility

pg_dump --verbose --data-only -h 127.0.0.1 -p 5432 -b --file="db-py.dump" --format=c --no-owner pydb

pg_dump command all in one line
Subversion cd <PROJECTIVITY>/utils

java -cp lib/svnkit.jar:lib/svnkit-cli.jar org.tmatesoft.svn.cli.SVNAdmin dump <PROJECTIVITY>/documents-repo > svn-py.dump

java command all in one line

this dump might be very big

Workspace Index copy the content of directory <PROJECTIVITY>/workspaces-index
Documents Index copy the content of directory <PROJECTIVITY>/documents-index
Frameworks Properties copy the content of directory <PROJECTIVITY>/frameworks you backup this once since it is static configuration data
Property file copy the content of directory <PROJECTIVITY>/server/projectivity/deploy/projectivity-properties-service.xml you backup this once since it is static configuration data
Email and Report templates copy the content of directories <PROJECTIVITY>/email_templates and <PROJECTIVITY>/report you backup this once since it is static configuration data


NOTES:

  1. <PROJECTIVITY> refers to the Projectivity Installation directory
  2. On Windows replace / with \

How to restore

DB

  1. delete old db
  2. recreate the db
  3. pg_restore --disable-triggers -d pydb -v -i -h 127.0.0.1 -p 5432 -U postgres db-py.dump

Subversion

  1. delete old repository
  2. create an empty repository
    cd <PROJECTIVITY>/utils
    java -cp lib/svnkit.jar:lib/svnkit-cli.jar org.tmatesoft.svn.cli.SVNAdmin create <PROJECTIVITY>/documents-repo
  3. load backup data
    cd <PROJECTIVITY>/utils
    java -cp lib/svnkit.jar:lib/svnkit-cli.jar org.tmatesoft.svn.cli.SVNAdmin load <PROJECTIVITY>/documents-repo < svn-py.dump

Other files

  1. Delete old files
  2. Copy back the backup files to the corresponding directories