Guys I am trying to backup a database.
First I connect to the server using a ssh tunel, then I execute the following command:
mongodump -d mydatabase -o ~/myfolder
and I get this message:
connected to: 127.0.0.1 Thu Feb 6 18:00:56 DATABASE: mydatabase to /home/backups/myfolder/myfolder
As you can see, the mongodump is creating a folder inside a folder, but inside this folder I don't have any files, no json, no bson file.
Could someone, explain me how to make a backup on my server using ssh and the move the files to my local machine.
Thanks in advance.
this is the command you are looking for. this command will access your server database locally 4321 is a port number which can be any port number in which you run your mongodb server root@144.154.22.11 and this is your server ip.
ssh -L 4321:localhost:27017 root@144.154.22.11 -f -N
and after this
mongodump --port 4321
this command will make your mongodb dump.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.