Backing up and Restoring GeoNode¶
In order to completely backup a GeoNode installation requires that each separate component of GeoNode be tackled separately. There are separate backup files for Geonode/Django and GeoServer.
Creating a backup¶
Make a backup of the GeoNode database (PostgreSQL needs to be running):
sudo -u postgres -i pg_dump -c -Fc geonode > geonodedb.backup
Stop all services:
sudo service apache2 stop sudo /etc/init.d/tomcat7 stop
Backup Geonode config & GeoServer data directory:
tar -cvzf geonodeConfigBackup.tgz /etc/geonode tar -cvzf geonodeDataBackup.tgz /var/lib/geoserver/geonode-data/
In addition, any templates, design changes, and/or CSS files will also need to be captured.
Restart all services:
sudo service apache2 start sudo /etc/init.d/tomcat7 start
Restoring a backup¶
First stop all services:
sudo service apache2 stop sudo /etc/init.d/tomcat7 stop
Restore Geonode config & GeoServer data directory:
sudo tar -C / -xvzf geonodeConfigBackup.tgz sudo tar -C / -xvzf geonodeDataBackup.tgz
In addition, any templates, design changes, and/or CSS files will need to be restored.
Make a backup of the GeoNode database (PostgreSQL needs to be running):
sudo service postgresql start sudo -u postgres -i "psql -c 'drop database geonode;'" sudo -u postgres -i "psql -c 'create database geonode;'" sudo -u postgres -s "pg_restore -Fc -d geonode /path/to/geonodedb.backup"
Start all services:
sudo service apache2 start sudo /etc/init.d/tomcat7 start
Notes¶
This approach works between machines with the same version of Linux and Geonode, and may not work between different versions of Linux, PostgreSQL, and PostGIS.