Migration / update problem new SSD

This suggests the backup you restored was from when you were experiencing a Backup problem - booking data missing.

If you want to give it another try, and you are able to find a backup with your booking data in, then hopefully the instructions below will help. If not, I understand, and perhaps these instructions will be useful to someone else.

Yes, it is caused by using a series 5.4 database with a series 5.6 server.

I will try and write a topic in How To/System Administrator soon on Backing Up and Restoring Tryton when Running on Docker. Briefly, one way is to dump the database from the postgres container, and backup the files from the /var/lib/tryton/db directory from inside the tryton container. Then restore them on the new system.

Yes, that probably would have avoided the problem. Then you could have worried about upgrading later.


To clean out all Docker containers, images and volumes from your system, and then get Tryton running again:

(Note: see How to run Tryton using Docker for detailed explainations of what some of these commands are doing)

  1. Clean up you docker containers, images and volumes, so you are back to a fresh docker install.

    WARNING don’t do this if you are running any other docker containers you want to keep as these next few instructions will remove them and all the data associated with them.

     sudo docker container rm --force $( sudo docker container ls --all -q )
     sudo docker image rm --force $( sudo docker image ls -q )
     sudo docker volume rm $( sudo docker volume ls -q )
    
  2. Get Tryton up and running using version you were running before (5.4 in this case), Note: change [your_secret_postgres_password] to a suitably secure password, and replace tryton-backup.sql with the file that contains the correct backup:

     # Create a network and volumes for use by the tryton containers
     sudo docker network create tryton
     sudo docker volume create tryton-data
     sudo docker volume create tryton-database
    
     # Start postgres
     POSTGRES_PASSWORD=[your_secret_postgres_password]
     sudo docker run \
         --name tryton-postgres \
         --env PGDATA=/var/lib/postgresql/data/pgdata \
         --env POSTGRES_DB=tryton \
         --env POSTGRES_PASSWORD=${POSTGRES_PASSWORD} \
         --mount source=tryton-database,target=/var/lib/postgresql/data \
         --network tryton \
         --detach \
         postgres:12
    
     # Restore your database
     sudo docker exec \
         --interactive \
         tryton-postgres \
         psql -U postgres <tryton-backup.sql
    
     # Start tryton version 5.4
     sudo docker run \
         --name tryton \
         --env DB_HOSTNAME=tryton-postgres \
         --env DB_PASSWORD=${POSTGRES_PASSWORD} \
         --mount source=tryton-data,target=/var/lib/trytond/db \
         --network tryton \
         --publish 127.0.0.1:8000:8000 \
         --detach \
         tryton/tryton:5.4
    

    You should now be able to connect to your Tryton system at http://localhost:8000/


  1. You are now ready to update to Tryton version 5.6 (if you want):

     # Stop tryton version 5.4
     sudo docker stop tryton
     sudo docker rm tryton
    

    Run any manual updates that are required, see How to apply SQL query on docker - #2 by dave.

     # Update the database to 5.6
     sudo docker run \
         --env DB_HOSTNAME=tryton-postgres \
         --env DB_PASSWORD=${POSTGRES_PASSWORD} \
         --network tryton \
         --interactive \
         --tty \
         --rm \
         tryton/tryton:5.6 \
         trytond-admin -d tryton --all
    
     # Start tryton version 5.6
     sudo docker run \
         --name tryton \
         --env DB_HOSTNAME=tryton-postgres \
         --env DB_PASSWORD=${POSTGRES_PASSWORD} \
         --mount source=tryton-data,target=/var/lib/trytond/db \
         --network tryton \
         --publish 127.0.0.1:8000:8000 \
         --detach \
         tryton/tryton:5.6