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 💗

  • 13 Votes
    27 Posts
    2k Views

    yuuuuu.png

  • Getting Eror When Started NodeBB

    Solved Configure
    7
    2 Votes
    7 Posts
    268 Views

    @phenomlab yes i did.

    i deleted one of plugin then it started to work normally.

  • 2 Votes
    11 Posts
    333 Views

    @veronikya said in mongodb replica set:

    The host’s local dns resolution is not configured. The problem of the host’s hosts being unable to be resolved in docker has been solved. Surprisingly
    Solution:
    Edit the /etc/resovel.conf file
    Add 127.0.0.53

    One immediate issue I can think of here is that editing resolv.conf directly is no longer supported and not recommended (because the changes do not survive a reboot) - unless you install the resolvconf package?

  • 4 Votes
    8 Posts
    335 Views

    @Panda said in Upgrade to NodeBB v3? 2BB or not 2BB, that is the question!:

    So although thats a plugin it has Widget like element and stopped working on the Theme change

    Which is normal based on the widgets being reset when you change themes.

  • 0 Votes
    2 Posts
    124 Views

    @mventures Quick reply is basically exactly that. However, it’s possible to trigger the full composer as below

    82ca1209-31be-4a51-a641-9887b5a238b8-image.png

    Failing that, you’ll need to use the reply button in the sticky toolbar

    1d230bcb-ff8e-4756-94f7-6e2fb7a94bc4-image.png

  • 5 Votes
    13 Posts
    506 Views
    'use strict'; const winston = require('winston'); const user = require('../user'); const notifications = require('../notifications'); const sockets = require('../socket.io'); const plugins = require('../plugins'); const meta = require('../meta'); module.exports = function (Messaging) { Messaging.notifyQueue = {}; // Only used to notify a user of a new chat message, see Messaging.notifyUser Messaging.notifyUsersInRoom = async (fromUid, roomId, messageObj) => { let uids = await Messaging.getUidsInRoom(roomId, 0, -1); uids = await user.blocks.filterUids(fromUid, uids); let data = { roomId: roomId, fromUid: fromUid, message: messageObj, uids: uids, }; data = await plugins.hooks.fire('filter:messaging.notify', data); if (!data || !data.uids || !data.uids.length) { return; } uids = data.uids; uids.forEach((uid) => { data.self = parseInt(uid, 10) === parseInt(fromUid, 10) ? 1 : 0; Messaging.pushUnreadCount(uid); sockets.in(`uid_${uid}`).emit('event:chats.receive', data); }); if (messageObj.system) { return; } // Delayed notifications let queueObj = Messaging.notifyQueue[`${fromUid}:${roomId}`]; if (queueObj) { queueObj.message.content += `\n${messageObj.content}`; clearTimeout(queueObj.timeout); } else { queueObj = { message: messageObj, }; Messaging.notifyQueue[`${fromUid}:${roomId}`] = queueObj; } queueObj.timeout = setTimeout(async () => { try { await sendNotifications(fromUid, uids, roomId, queueObj.message); } catch (err) { winston.error(`[messaging/notifications] Unabled to send notification\n${err.stack}`); } }, meta.config.notificationSendDelay * 1000); }; async function sendNotifications(fromuid, uids, roomId, messageObj) { const isOnline = await user.isOnline(uids); uids = uids.filter((uid, index) => !isOnline[index] && parseInt(fromuid, 10) !== parseInt(uid, 10)); if (!uids.length) { return; } if (roomId != 11) { // 5 Is the ID of the ID of the global chat room. Messaging.getUidsInRoom(roomId, 0, -1); // Proceed as normal. } else { user.getUidsFromSet('users:online', 0, -1); // Only notify online users. } const { displayname } = messageObj.fromUser; const isGroupChat = await Messaging.isGroupChat(roomId); const notification = await notifications.create({ type: isGroupChat ? 'new-group-chat' : 'new-chat', subject: `[[email:notif.chat.subject, ${displayname}]]`, bodyShort: `[[notifications:new_message_from, ${displayname}]]`, bodyLong: messageObj.content, nid: `chat_${fromuid}_${roomId}`, from: fromuid, path: `/chats/${messageObj.roomId}`, }); delete Messaging.notifyQueue[`${fromuid}:${roomId}`]; notifications.push(notification, uids); } };
  • 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 🤪🤪😁.