Operating system updates

sudo apt-get update
sudo apt-get dist-upgrade

Application backup


sudo -u postgres pg_dump -Fc geotrekdb > `date +%Y%m%d%H%M`-database.backup

Media files

tar -zcvf `date +%Y%m%d%H%M`-media.tar.gz /opt/geotrek-admin/var/media/


tar -zcvf `date +%Y%m%d%H%M`-conf.tar.gz /opt/geotrek-admin/var/conf/

Application restore

If you restore Geotrek-admin on a new server, you will have to install PostgreSQL and PostGIS and create a database user first. Otherwise go directly to the database creation step.

Example for Ubuntu 18:

sudo apt install postgresql-10 postgresql-10-postgis-2.4
sudo -u postgres psql -c "CREATE USER geotrek PASSWORD 'geotrek';"

Create an empty database (geotrekdb in this example):

sudo -u postgres psql -c "CREATE DATABASE geotrekdb OWNER geotrek ENCODING 'UTF8' TEMPLATE template0;"
sudo -u postgres psql -d geotrekdb -c "CREATE EXTENSION postgis;"

Restore backup:

sudo -u postgres pg_restore -d geotrekdb 20200510-geotrekdb.backup

Extract media and configuration files:

tar -zxvf 20200510-media.tar.gz
tar -zxvf 20200510-conf.tar.gz

Follow Fresh installation method. Choose to manage database by yourself.

PostgreSQL optimization

Access your database securely on your local machine (QGIS)

Instead of opening your database to the world (by opening the 5432 port for example), you can use SSH tunnels.

Major evolutions from version 2.33

From version 2.33, Geotrek-admin is packaged in a debian package. This mean several things :

  • a system user geotrek is created on install ;
  • base code is located in /opt/geotrek-admin folder ;
  • geotrek is the new command, replacing bin/django, and must be run in root (system user geotrek is used after) ;
  • there is no more settings.ini but an env file with environment variables ;
  • configuration files ( et env), parsers and all customisation files (templates and translations) are now located in /opt/geotrek-admin/var/conf ;
  • we advise you to configure data synchronization in /opt/geotrek-admin/var