Yes, when restoring you don’t need to specify the database (leave off the -d tryton
part). This is stopping that database from being dropped.
So just to recap I’ve just tried a slightly simplified full process from the start:
-
Create your Tryton docker system:
$ sudo docker run --name tryton-postgres -e POSTGRES_PASSWORD=mysecretpassword -e POSTGRES_DB=tryton -d postgres $ sudo docker run --link tryton-postgres:postgres -e DB_PASSWORD=mysecretpassword -it tryton/tryton trytond-admin -d tryton --all "admin" email for "tryton": admin@example.com "admin" password for "tryton": "admin" password confirmation: $ sudo docker run --name tryton -p 8000:8000 --link tryton-postgres:postgres -e DB_PASSWORD=mysecretpassword -d tryton/tryton
-
Connect to http://localhost:8000 in your browser, or with the desktop client, login and use Tryton.
-
Make a backup (you shouldn’t really need to stop and start tryton here):
$ sudo docker stop tryton $ sudo docker exec tryton-postgres pg_dump -C -c -U postgres -O tryton >tryton-backup.sql $ sudo docker start tryton
-
Connect to http://localhost:8000 in your browser, or with the desktop client, login and use Tryton. Create records, activate modules, etc…
-
Restore the system back to the point where the backup was made:
$ sudo docker stop tryton $ sudo docker restart tryton-postgres $ sudo docker exec -i tryton-postgres psql -U postgres <tryton-backup.sql $ sudo docker start tryton
-
Connect to http://localhost:8000 in your browser, or with the desktop client, login and use Tryton as it was at the point of the backup.