0

I was using the local mongo database. Now I dockerized my entire application on another remote system including MongoDB. So that, I need to migrate my local mongo dump into the docker container.

How can I import all the data from local MongoDB to the docker container's MongoDB?

1 Answers1

0

The following steps should work:

  • Dump the data from local mongodb
  • Copy dump file to remote system
  • Copy dump file to mongo container using docker cp command:
  • Enter mongo container: docker exec -it [container_id] bash
  • Restore the dump using inside the container.
rok
  • 9,403
  • 17
  • 70
  • 126