Hi docker Guys :wink: I've seen that spryker now ...
# docker
m
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.
m
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
you can omit clean but this will leave containers that will not be used
m
Ok @melodic-translator-48489 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
m
then run clean 😄
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
m
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?
m
yes
m
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
m
maybe there is, I am just no aware of it
you can try, doing bootstrap and then reset
m
ok.. me too.. because reinstall was also my first idea.. just as u described...
m
reset will -
Remove and build all Spryker images and volumes
would need to check if it is leaving storages intact
m
ok. i will try.. thanks
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
m
deploy.yml changes are only taken into account when you run bootstrap
m
yes i know.. i thouth that the reset command before build process take care on bootstrap self
m
your order is what I would do - only thing that make wonder why up after clean did not run data import
it should
m
yes.. i see too... it just run demo-data to initialise db but not import data...
m
ok, I just learned something new
maybe behavior changed
m
yes.. it make sense... just one command and everything fresh there..
p
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.
👍 1