To backup the database, in **another** terminal (or a Docker Quickstart Terminal)::
cd Manifeste
- scripts/backup.sh
+ scripts/push.sh
giving your user password if asked...
To restore the backuped database, in another terminal (or a Docker Quickstart Terminal)::
cd Manifeste
- scripts/restore.sh
+ scripts/pull.sh
If the app is broken after a restore script, restart the composition with::
+++ /dev/null
-from django.core.exceptions import MiddlewareNotUsed
-from django.conf import settings
-from django.core.management import call_command
-
-
-class StartupMiddleware(object):
-
- def __init__(self):
- up = False
- print 'check..................................'
- while not up:
- try:
- # # The following db settings name is django 1.2. django < 1.2 will use settings.DATABASE_NAME
- # if settings.DATABASES['default']['NAME'] == ':memory:':
- call_command('syncdb', interactive=False)
- call_command('collectstatic', interactive=False)
- up = True
- except:
- print 'waiting...'
- time.sleep(1)
-
- raise MiddlewareNotUsed('Startup complete')
+++ /dev/null
-#!/bin/sh
-
-docker-compose run db /srv/scripts/backup_db.sh
-git add data/media
-git commit -a -m "update DB and media"
-git push
--- /dev/null
+#!/bin/sh
+
+sudo chown -R $USER data/media
+sudo chown -R $USER data/backup
+git pull
+git submodule foreach git pull origin master
+docker-compose run db /srv/scripts/restore_db.sh
--- /dev/null
+#!/bin/sh
+
+docker-compose run db /srv/scripts/backup_db.sh
+git add data/media
+git commit -a -m "update DB and media"
+git push
+++ /dev/null
-#!/bin/sh
-
-sudo chown -R $USER data/media
-sudo chown -R $USER data/backup
-git pull
-git submodule foreach git pull origin master
-docker-compose run db /srv/scripts/restore_db.sh