My forum is using MongoDB and I notice nodebb keeps bunch of data on socket.io collection. Can I clean them?
Presuming you are jacked into the command line on the server hosting your mongodb, it should be something like this:
mongodump --out /var/backups/mongo/$(date +%F)
I say "something like" because the simple form above would represent a poorly secured mongodb. Hence, you will most likely need a few additional flags:
mongodump -u "YourDbAdminUser" -p "SomePassPhrase" --out /var/backups/mongo/$(date +%F) --authenticationDatabase=admin
Upon successful completion that command will create a directory structure under /var/backups/mongo containing a full backup of your mongo database(s). You will then need to mongorestore this to your new server.
Mind you, the above only gets the database. You will likely also want the public file uploads and such. I suggest you review the NodeBB Upgrade Docs for further clarification.
You can copy the entire database if the database is used only for nodebb
mongodump -o /mydir/
when transferring a database to another server, you need to copy the database dump and run the command
The user and all the data will be automatically transferred