Skip to content

Nodebb: failed to restore a mongo dump

Solved Configure
  • hello @phenomlab

    i want to restore my production db mongo backup to my dev environnement

    I have set the same ID/password for mongo admin users, same user for same database name and same password.

    Hhere is the file of the dump

    root@nodebbpwclonedb:/home/nodebb/nodebb_DB_20230107/nodebb# ls -lsah
    total 1,6G
    4,0K drwxr-xr-x 2 nodebb nodebb 4,0K  7 janv. 23:09 .
    4,0K drwxr-xr-x 3 nodebb nodebb 4,0K  7 janv. 23:08 ..
    1,5G -rw-r--r-- 1 nodebb nodebb 1,5G  7 janv. 03:30 objects.bson
    4,0K -rw-r--r-- 1 nodebb nodebb  603  7 janv. 03:30 objects.metadata.json
     18M -rw-r--r-- 1 nodebb nodebb  18M  7 janv. 03:30 searchpost.bson
    4,0K -rw-r--r-- 1 nodebb nodebb  492  7 janv. 03:30 searchpost.metadata.json
    276K -rw-r--r-- 1 nodebb nodebb 275K  7 janv. 03:30 searchtopic.bson
    4,0K -rw-r--r-- 1 nodebb nodebb  493  7 janv. 03:30 searchtopic.metadata.json
       0 -rw-r--r-- 1 nodebb nodebb    0  7 janv. 03:30 sessions.bson
    4,0K -rw-r--r-- 1 nodebb nodebb  314  7 janv. 03:30 sessions.metadata.json
    

    and the command I use for restore with the result :

    nodebb@nodebbpwclonedb:~/nodebb$ sudo mongorestore --username admin --password XXXXXXXXXXXXXXX --nsInclude nodebb.objects --drop /home/nodebb/nodebb_DB_20230107/nodebb/
    [sudo] Mot de passe de nodebb : 
    2023-01-07T23:14:07.617+0100    preparing collections to restore from
    2023-01-07T23:14:07.617+0100    don't know what to do with file "/home/nodebb/nodebb_DB_20230107/nodebb/objects.bson", skipping...
    2023-01-07T23:14:07.617+0100    don't know what to do with file "/home/nodebb/nodebb_DB_20230107/nodebb/objects.metadata.json", skipping...
    2023-01-07T23:14:07.617+0100    don't know what to do with file "/home/nodebb/nodebb_DB_20230107/nodebb/searchpost.bson", skipping...
    2023-01-07T23:14:07.617+0100    don't know what to do with file "/home/nodebb/nodebb_DB_20230107/nodebb/searchpost.metadata.json", skipping...
    2023-01-07T23:14:07.617+0100    don't know what to do with file "/home/nodebb/nodebb_DB_20230107/nodebb/searchtopic.bson", skipping...
    2023-01-07T23:14:07.617+0100    don't know what to do with file "/home/nodebb/nodebb_DB_20230107/nodebb/searchtopic.metadata.json", skipping...
    2023-01-07T23:14:07.617+0100    don't know what to do with file "/home/nodebb/nodebb_DB_20230107/nodebb/sessions.bson", skipping...
    2023-01-07T23:14:07.617+0100    don't know what to do with file "/home/nodebb/nodebb_DB_20230107/nodebb/sessions.metadata.json", skipping...
    2023-01-07T23:14:07.617+0100    0 document(s) restored successfully. 0 document(s) failed to restore.
    

    grrrrrrr

  • @phenomlab

    In fact I specified the sub rep and not the rep

    DON’T DO THIS:

    nodebb@nodebbpwclonedb:~/nodebb$ sudo mongorestore --username admin --password XXXXXXXXXXXXXX --nsInclude nodebb.objects --drop /home/nodebb/nodebb_DB_20230107/nodebb/
    

    BUT THIS :

    nodebb@nodebbpwclonedb:~/nodebb$ sudo mongorestore --username admin --password XXXXXXXXXXXXXX --nsInclude nodebb.objects --drop /home/nodebb/nodebb_DB_20230107/
    

    🙂

  • DownPWundefined DownPW has marked this topic as solved on

Did this solution help you?
Did you find the suggested solution useful? Why not buy me a coffee? It's a nice gesture, and a great way to show your appreciation 💗

  • 2 Votes
    3 Posts
    160 Views

    Ah silly me, thanks for finding that!

  • NodeBB: hCaptcha

    Solved Configure
    15
    2 Votes
    15 Posts
    350 Views

    @mventures none that I know of. I don’t recall selecting these either for mine.

  • 3 Votes
    17 Posts
    479 Views

    @mventures Ok. No issues

  • 0 Votes
    5 Posts
    199 Views

    @mventures Yes, exactly. The other icon will restart NodeBB whilst the first icon I referenced will rebuild (recompile) it.

    The huge strength of NodeBB over Flarum (for example) is that the code is precompiled, and called once at boot. PHP’s code has to repeatedly reload code from source making it much slower.

  • nodebb loading emojis

    Solved Configure
    16
    1 Votes
    16 Posts
    465 Views

    @DownPW sure. Let me have a look at this in more detail. I know nginx plus has extensive support for this, but it’s not impossible to get somewhere near acceptable with the standard version.

    You might be better off handling this at the Cloudflare level given that it sits in between the requesting client and your server.

  • 3 Votes
    2 Posts
    136 Views

    @DownPW This isn’t something I have readily available, and because I’m not entirely familiar with the database structure of NodeBB, it’s something that would require research and development in terms of script.

    I think it’d be quicker to ask this in the NodeBB forums.

  • Mongodb Authorisation.

    Solved General
    17
    2 Votes
    17 Posts
    502 Views

    @Sampo2910 I just saw this on the NodeBB community site and it seems very much in line with the issue you are experiencing. Worth a look I think

    https://community.nodebb.org/topic/16826/does-nodebb-work-with-mongodb-6-0

  • NodeBB metadata

    Solved Configure
    4
    2 Votes
    4 Posts
    368 Views

    @phenomlab said in NodeBB metadata:

    @jac Are you sure ?

    https://www.google.co.uk/search?q=site%3Astockportcounty.fans&sxsrf=AOaemvLwnaZL-PliU_2dBOg_Eo1pMVhBjg%3A1638982328139&source=hp&ei=uOKwYeatBcOsad3yp7AE&iflsig=ALs-wAMAAAAAYbDwyLBSDcG5XYoFCKwQFhgz94wTxOcV&ved=0ahUKEwjm6dX71NT0AhVDVhoKHV35CUYQ4dUDCAk&uact=5&oq=site%3Astockportcounty.fans&gs_lcp=Cgdnd3Mtd2l6EAM6BAgjECc6CwgAEIAEELEDEIMBOg4ILhCABBCxAxDHARCjAjoRCC4QgAQQsQMQgwEQxwEQowI6BQguEIAEOggIABCABBCxAzoFCAAQgAQ6CAguELEDEIMBOgsILhCABBDHARCvAToICC4QgAQQsQM6BQgAELEDOgsILhCABBDHARDRAzoLCAAQgAQQsQMQyQM6BQgAEJIDUABYySZg0CdoAHAAeACAAW2IAa0NkgEEMjMuMpgBAKABAQ&sclient=gws-wiz

    Fair enough 🤪🤪😁.