What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

Hi docker Guys πŸ˜‰ I've seen that spryker now is compatible with newer version of Postgres (offi

giovanni.piemontese
giovanni.piemontese Technical Lead @ LΓΆffelhardt Spryker Solution Partner Posts: 871 πŸ§‘πŸ»β€πŸš€ - Cadet

Hi docker Guys πŸ˜‰

I've seen that spryker now is compatible with newer version of Postgres (officially πŸ™‚ )
-> https://github.com/spryker/docker-sdk/tree/master/generator/src/templates/service/postgres

What are the steps to migrate correctly to new version (12 i.e.) locally? Of course task 1 is set version in deploy.yml and deploy.dev.yml (or default set). After that? We have to remove the container or just run bootstrap!? I want just write the migration for all devs in project.
Thank u very much in advance.

Comments

  • UKHD8KTMF
    UKHD8KTMF Posts: 393 πŸ§‘πŸ»β€πŸš€ - Cadet

    Hi, I suggest:
    * stopping the containers (if they are running) docker/sdk stop

    • , running clean docker/sdk clean
    • and then boostrap docker/sdk boostrap deploy.dev.yml
    • and then run up docker/sdk up
  • UKHD8KTMF
    UKHD8KTMF Posts: 393 πŸ§‘πŸ»β€πŸš€ - Cadet

    you can omit clean but this will leave containers that will not be used

  • giovanni.piemontese
    giovanni.piemontese Technical Lead @ LΓΆffelhardt Spryker Solution Partner Posts: 871 πŸ§‘πŸ»β€πŸš€ - Cadet

    Ok @UKHD8KTMF but what is about data?

    When i upgraded the ES version 6 months ago then i must remove container otherwise it was not more working -> https://sprykercommunity.slack.com/archives/CMYFJCG2E/p1576585779010200

  • UKHD8KTMF
    UKHD8KTMF Posts: 393 πŸ§‘πŸ»β€πŸš€ - Cadet

    then run clean πŸ˜„

  • UKHD8KTMF
    UKHD8KTMF Posts: 393 πŸ§‘πŸ»β€πŸš€ - Cadet

    I would personally run docker system prune - but this is not without side effects, because it will clean images/volumes etc everywhere and this is not acceptable to some

  • giovanni.piemontese
    giovanni.piemontese Technical Lead @ LΓΆffelhardt Spryker Solution Partner Posts: 871 πŸ§‘πŸ»β€πŸš€ - Cadet

    Ok.. but clean - Stop all Spryker containers and remove images and volumes. and it means that i have to re-intall the whole application locally.. right?

  • UKHD8KTMF
    UKHD8KTMF Posts: 393 πŸ§‘πŸ»β€πŸš€ - Cadet

    yes

  • giovanni.piemontese
    giovanni.piemontese Technical Lead @ LΓΆffelhardt Spryker Solution Partner Posts: 871 πŸ§‘πŸ»β€πŸš€ - Cadet

    ok. clear now... thank u very much..

    p.s.: i thought that maybe there was another way to save db data, swithc version and then restore data... without re-install the application

  • UKHD8KTMF
    UKHD8KTMF Posts: 393 πŸ§‘πŸ»β€πŸš€ - Cadet

    maybe there is, I am just no aware of it

  • UKHD8KTMF
    UKHD8KTMF Posts: 393 πŸ§‘πŸ»β€πŸš€ - Cadet

    you can try, doing bootstrap and then reset

  • giovanni.piemontese
    giovanni.piemontese Technical Lead @ LΓΆffelhardt Spryker Solution Partner Posts: 871 πŸ§‘πŸ»β€πŸš€ - Cadet

    ok.. me too.. because reinstall was also my first idea.. just as u described...

  • UKHD8KTMF
    UKHD8KTMF Posts: 393 πŸ§‘πŸ»β€πŸš€ - Cadet

    reset will - Remove and build all Spryker images and volumes

  • UKHD8KTMF
    UKHD8KTMF Posts: 393 πŸ§‘πŸ»β€πŸš€ - Cadet

    would need to check if it is leaving storages intact

  • giovanni.piemontese
    giovanni.piemontese Technical Lead @ LΓΆffelhardt Spryker Solution Partner Posts: 871 πŸ§‘πŸ»β€πŸš€ - Cadet

    ok. i will try.. thanks

  • giovanni.piemontese
    giovanni.piemontese Technical Lead @ LΓΆffelhardt Spryker Solution Partner Posts: 871 πŸ§‘πŸ»β€πŸš€ - Cadet

    reset remove all data and intialise all new.. and not take care on deploy.dev.yml changes..

    After reset now bootstrap and i get the same error that database is not running, please check name etc...

    it means:
    stop
    clean
    bootstrap
    up
    demo-data

  • UKHD8KTMF
    UKHD8KTMF Posts: 393 πŸ§‘πŸ»β€πŸš€ - Cadet

    deploy.yml changes are only taken into account when you run bootstrap

  • giovanni.piemontese
    giovanni.piemontese Technical Lead @ LΓΆffelhardt Spryker Solution Partner Posts: 871 πŸ§‘πŸ»β€πŸš€ - Cadet

    yes i know.. i thouth that the reset command before build process take care on bootstrap self

  • UKHD8KTMF
    UKHD8KTMF Posts: 393 πŸ§‘πŸ»β€πŸš€ - Cadet

    your order is what I would do - only thing that make wonder why up after clean did not run data import

  • UKHD8KTMF
    UKHD8KTMF Posts: 393 πŸ§‘πŸ»β€πŸš€ - Cadet

    it should

  • giovanni.piemontese
    giovanni.piemontese Technical Lead @ LΓΆffelhardt Spryker Solution Partner Posts: 871 πŸ§‘πŸ»β€πŸš€ - Cadet

    yes.. i see too... it just run demo-data to initialise db but not import data...

  • UKHD8KTMF
    UKHD8KTMF Posts: 393 πŸ§‘πŸ»β€πŸš€ - Cadet

    ok, I just learned something new

  • UKHD8KTMF
    UKHD8KTMF Posts: 393 πŸ§‘πŸ»β€πŸš€ - Cadet

    maybe behavior changed

  • giovanni.piemontese
    giovanni.piemontese Technical Lead @ LΓΆffelhardt Spryker Solution Partner Posts: 871 πŸ§‘πŸ»β€πŸš€ - Cadet

    yes.. it make sense... just one command and everything fresh there..

  • Unknown
    edited June 2020

    Hi Giovanni,

    In case you really need to save the data, you might want to consider the following flow (we tested it only to increase version:

    For pg:
    1. docker exec spryker_demo_database_1 pg_dumpall -U root > dump.sql
    2. docker/sdk down
    3. docker volume rm spryker_demo_database-postgres-data
    4. Change version into docker/deployment/default/docker-compose.yml for database
    5. docker/sdk run
    6. docker cp dump.sql spryker_demo_database_1:/var/lib/postgresql/data
    7. docker exec -it spryker_demo_database_1 bash
    8. psql -U root < /var/lib/postgresql/data/dump.sql
    I hope it will help and provides a guideline of how to upgrade PostgreSQL to a higher version and preserve the data.