Search code examples
cloud-foundrymongodumpswisscomdev

migrate MongoDB container service - mongodump command not found


I am trying to migrate my MongoDB container by following the Swisscom tutorial. I am currently stuck because I cannot do the mongodump command

$ mongodump --host localhost:13000 --authenticationDatabase <old-db-database> -u <old-db-username> -d <old-db-database>
Enter password: <old-db-password>

I tried to connect in SSH and execute the command but it didn't work.

U:\Documents\cf-env-master>cf ssh proxy-app -L 13000:2xtorvw9ys7tg9pc.service.consul:49642
vcap@ff9e229f-d570-4c6e-52fd-0a45:~$
vcap@ff9e229f-d570-4c6e-52fd-0a45:~$
vcap@ff9e229f-d570-4c6e-52fd-0a45:~$ mongodump --host localhost:13000 --authenticationDatabase Po1CA54gQdhmtCTa -u z2WScqr5y06j4ncx -d Po1CA54gQdhmtCTa
bash: mongodump: command not found

Mongo is correctly installed locally. I can access mongo, mongodump and mongorestore.


Solution

  • You must execute mongodump locally, not on the app container. The ssh connection is only opened to establish a tunnel (kind of a tcp port forwarding). The rest of the commands need to be executed in a separate terminal locally.