-# COMPTOIR-srv Installation
-
-(formerly kown as "manivelle")
-
-This is the installation of Comptoir-SRV, part of "Comptoir du Libre" that provides the engine with its API.
-(The web interface is provided by the project Comptoir-WEB.)
+# COMPTOIR-SRV install
## 1. Prerequisites
},
...
```
-
-
-## Update
-
-Update composer dependencies:
-
-```sh
-composer update
-```
-
tar cvfj ${SAVE_WEBROOT_FILES_FILE} files/
```
+## Restore
+
+Principle:
+
+1. Remove DB content (but keep schema structure)
+2. Import DB data
+3. Save `webroot/files` directory
+4. From `webroot` directory, extract dump of `files`
+
+Let say dump files are located in `/tmp/` and named:
+
+* `SAVE_COMPTOIR_<TIMESTAMP>_Data_only.sql.bz2` for DB content
+* `SAVE_COMPTOIR_<TIMESTAMP>_Dir_Files.tar.bz2` for `files` directory
+
+Say
+
+```sh
+TIMESTAMP="2016-06-28-15h06m42"
+```
+
+From the directory containing all Comptoir-SRV code, do:
+
+```shell
+psql -U comptoir -W -f config/SQL/COMPTOIR_Purge_tables_content.sql
+bunzip2 /tmp/SAVE_COMPTOIR_${TIMESTAMP}_Data_only.sql.bz2
+psql -U comptoir -W -f /tmp/SAVE_COMPTOIR_${TIMESTAMP}_Data_only.sql
+cd webroot
+mv files/ files-tmp/
+tar xvfj /tmp/SAVE_COMPTOIR_${TIMESTAMP}_Dir_Files.tar.bz2
+sudo chgrp -R www-data files/
+find . files/ -type f -exec sudo chmod 664 {} \;
+find . files/ -type d -exec sudo chmod 775 {} \;
+```
+
+Verify in the app everything is OK, then `rm -rf files-tmp/`
-# CakePHP Application Skeleton
+# COMPTOIR-srv
-[![Build Status](https://api.travis-ci.org/cakephp/app.png)](https://travis-ci.org/cakephp/app)
-[![License](https://poser.pugx.org/cakephp/app/license.svg)](https://packagist.org/packages/cakephp/app)
+(formerly kown as "manivelle")
-A skeleton for creating applications with [CakePHP](http://cakephp.org) 3.x.
-
-The framework source code can be found here: [cakephp/cakephp](https://github.com/cakephp/cakephp).
+This is the installation of Comptoir-SRV, part of "Comptoir du Libre" that provides the engine with its API.
+(The web interface is provided by the project Comptoir-WEB.)
## Installation
-1. Download [Composer](http://getcomposer.org/doc/00-intro.md) or update `composer self-update`.
-2. Run `php composer.phar create-project --prefer-dist cakephp/app [app_name]`.
-
-If Composer is installed globally, run
-```bash
-composer create-project --prefer-dist cakephp/app [app_name]
-```
+see `Documentation/INSTALL.md`
-You should now be able to visit the path to where you installed the app and see
-the setup traffic lights.
+## Update composer dependencies
-## Configuration
+```sh
+composer update
+```
-Read and edit `config/app.php` and setup the 'Datasources' and any other
-configuration relevant for your application.