E
E
EVOSandru62018-11-19 10:56:41
PostgreSQL
EVOSandru6, 2018-11-19 10:56:41

How can I transfer a volume from a postgres database to another host without loss?

Good afternoon,
There is docker-compose.yml :

version: '3.7'
...
pgsql:
    image: postgres:9.6-alpine
    environment:
      - POSTGRES_USER=${DB_USER}
      - POSTGRES_PASSWORD=${DB_PASSWORD}
      - POSTGRES_DATABASE=${DB_NAME}
    ports:
      - 54321:5432
    volumes:
      - ./storage/postgres:/var/lib/postgresql/data

When docker compose-up --build -dthe folder is thrown, the site works, the data is migrated, saved.
One person suggested doing this if it's not docker-compose.yml:
spoiler

docker run --restart always -d --name main-ctr -p 9090:8080 --link pg x:2;
docker logs -f main-ctr
docker run --restart always -d --name pg -v /root/pgdata:/var/lib/postgresql/data postgres:alpine
Но я так понял, что --link - стал @deprecated начиная с 3 версии

Now the question is - do I need to move to another host from another provider. As I understand it, it’s not enough for me to just copy the storage folder and paste it into the project folder in a new location, because. in a simple PhpStorm file manager, it is generally empty.
Tell me - what actions need to be taken to transfer data without losing anything? Is it possible without manual migrations?
And another question is what are there against using docker on hosting against manual deployment in the old fashioned way. Read the opinion that this is kind of unreliable and the speed is very lost.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
ky0, 2018-11-19
@EVOSandru6

what are the cons of using docker hosting

If you do not add the DBMS data inside the container, in general, none.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question