@Kolt-L It depends on your set up details, of which I know not. But maybe resembles something like:
mongodump -u <your mongo user here> -p <your mongo user pass here> --out /where/you/want/the/backup/files/$(date +%F) --authenticationDatabase=admin
If, perchance ye' followed the nodebb docs for setting up mongodb here https://docs.nodebb.org/configuring/databases/mongo/ and here https://docs.nodebb.org/installing/os/ubuntu/ then you should have an admin user. Hopefully you still have that pass tucked away safe somewhere.
/where/you/want/the/backup/files/$(date +%F) should now be populated with sub directories for each of the admin and nodebb databases. Ensure you copy them both to the new server.
For future reference, I prefer not to have my privileged admin user running cron scripts so I created a "backup operator" user with limited privileges for such duties. YMMV.
Note: You may need to quote the pass phrase if it contains special characters.