I have a script that does daily backups for me. I copied the most recent one to the new server.
Restored it using mongorestore or whatever the command is to restore mongo databases. It's been a while so the commands are not fresh in my head.
Once the database has been restored correctly you can run the NodeBB installer.
When it asks for the database you will just tell it the database name of the database you just restored.
This should then install NodeBB with your old database.
Unless something has changed with the later versions of NodeBB then this procedure should work.