OLD_VERSION=2.6.0
NEW_VERSION=2.7.0

##Rename old version
mv Geotrek Geotrek-$OLD_VERSION

##Download new version
https://github.com/makinacorpus/Geotrek/archive/2.6.0.zip
wget https://github.com/makinacorpus/Geotrek/archive/$NEW_VERSION.zip
unzip $NEW_VERSION.zip

mv Geotrek-$NEW_VERSION Geotrek
cd Geotrek

# Configuration files
cp -aR ../Geotrek-$OLD_VERSION/etc/ .

# Uploaded files
cp -aR ../Geotrek-$OLD_VERSION/var/ .

# If you have advanced settings
cp ../Geotrek-$OLD_VERSION/geotrek/settings/custom.py geotrek/settings/custom.py


# Other configuration files
mkdir -p ./geotrek/locale/fr/LC_MESSAGES/
cp -aR ../Geotrek-$OLD_VERSION/geotrek/locale/fr/LC_MESSAGES/* ./geotrek/locale/fr/LC_MESSAGES/

cp -aR ../Geotrek-$OLD_VERSION/templates .


# Re-run install
./install.sh


# Empty cache
sudo service memcached restart


