## Export DB Scructure only
-```shell
-pg_dump -U comptoir -W --schema-only -f COMPTOIR_DB_Structure.sql
-```
-## Export DB data only
+View file `bin/COMPTOIR_export_DB_structure_only.sh`
-```shell
-DUMP_PATH=/tmp
-TIMESTAMP=$(date +%Y-%m-%d-%Hh%mm%S)
-SRV_PATH=/home/comptoir/manivelle-srv
+## Export DB data only
-SAVE_SQL_FILE="${DUMP_PATH}/SAVE_COMPTOIR_${TIMESTAMP}_Data_only.sql"
-SAVE_WEBROOT_FILES_FILE="${DUMP_PATH}/SAVE_COMPTOIR_${TIMESTAMP}_Dir_Files.tar.bz2"
-pg_dump -U comptoir -W --data-only -f ${SAVE_SQL_FILE}
-bzip2 ${SAVE_SQL_FILE}
-cd ${SRV_PATH}/webroot/
-tar cvfj ${SAVE_WEBROOT_FILES_FILE} files/
-```
+View file `bin/COMPTOIR_export_DB_data_AND_images.sh`
## 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
-sudo mv files/ files-tmp/
-sudo 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 `sudo rm -rf files-tmp/`
+Follow help from file `bin/COMPTOIR_import_DB_data_AND_images.sh`