Find a way of syncing prod/dev db's #4

Open
opened 2024-06-19 16:56:10 +00:00 by tma · 2 comments
Owner
No description provided.
tma added the
infrastructure
label 2024-06-19 16:56:10 +00:00
Owner

It's possible to make a dump of the remote DB with something like:

(export DOCKER_CONTEXT=swarm-demo.autonomic.zone; docker exec -it $(docker ps -q -f name=nextload-demo_autonomic_zone_mongo) bash)
cd /tmp
mongodump -u mongo -p $(cat /run/secrets/mongo_password)

How we've handled syncing for Wordpress is to have a makefile target which fetches this from the running server, then loads it into the local database instance. If that seems like a reasonable approach, we could reproduce that with mongo; questions include:

  1. How to make this a 1-liner, given that the password lookup likely should happen remotely in the container
  2. How to load a dump into a running Mongo instance, ideally dropping existing content first
  3. Whether there are any changes which need to be made to the data during or after loading
It's possible to make a dump of the remote DB with something like: ``` (export DOCKER_CONTEXT=swarm-demo.autonomic.zone; docker exec -it $(docker ps -q -f name=nextload-demo_autonomic_zone_mongo) bash) cd /tmp mongodump -u mongo -p $(cat /run/secrets/mongo_password) ``` How we've handled syncing for Wordpress is to have a `makefile` target which fetches this from the running server, then loads it into the local database instance. If that seems like a reasonable approach, we could reproduce that with mongo; questions include: 1. How to make this a 1-liner, given that the password lookup likely should happen remotely in the container 2. How to load a dump into a running Mongo instance, ideally dropping existing content first 3. Whether there are any changes which need to be made to the data during or after loading
Author
Owner

Got pretty far on this one. sync_db and sync_media both work, but only initially. Think some intermediate step needs to have it's files removed but I'm not seeing it right now

Got pretty far on this one. sync_db and sync_media both work, but only initially. Think some intermediate step needs to have it's files removed but I'm not seeing it right now
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: autonomic-cooperative/nextload#4
No description provided.