Migrate NodeBB from MongoDB to Redis?

General Discussion

Suggested Topics


  • 1 Votes
    12 Posts
    4k Views

    That is an acceptable solution 👍

  • 0 Votes
    3 Posts
    5k Views

    @a_5mith

    Yes I have already checked it. I have found a docker image created by @nopz, this one is up-to-date. But the official docker image in not! Maybe you (nodebb) should give access to a dockerfile to allow anyone to build a nodebb docker image. EDIT I found the dockerfile, and the problem about this outdated version here. It's outdated because the dockerfile build the image with the v0.5.x version :

    FROM centos:centos7 MAINTAINER NodeBB Docker Team <[email protected]> # install main packages: RUN yum -y update ; yum clean all RUN yum -y install epel-release tar ; yum clean all RUN yum -y install wget ; yum clean all RUN yum -y groupinstall "Development Tools" RUN yum -y install nodejs git ImageMagick npm RUN yum -y install openssl openssl-devel # clone nodebb and install it RUN cd /opt ; git clone -b v0.5.x https://github.com/NodeBB/NodeBB nodebb RUN cd /opt/nodebb ; npm install # Create a nodebb volume VOLUME /opt/nodebb # Define a working directory WORKDIR /opt/nodebb # Expose ports EXPOSE 80 EXPOSE 443 EXPOSE 4567 CMD [ "node", "app.js" ]

    You should (NodeBB) update this dockerfile !

    End of the EDIT

    Now, with the nopz/nodebb image I just had a problem about plugin persistence. But the first installation is so much easier and automatic with just one docker.

    Thanks for your answer by the way 🙂

  • 0 Votes
    2 Posts
    2k Views

    Hello and welcome to the NodeBB community!

    Are you using nodebb-plugin-import?
    That seems like the only one worth a shot today from what i can find.

    Simply follow the instructions in the README, there are some handy tips there for converting BBcode and such aswell.

    Sure having a separate database server is recommended, but really not needed - you should backup your dumps externally just in case if you don't though.
    If you're going with redis, this may be useful for that cause.

    This probably isn'tthe most helpful post, as i haven't migrated from another software myself, but i'm trying to help in possible ways.

  • 0 Votes
    1 Posts
    1k Views

    Anyone know if Minimongo could be used in a plugin to enable redis-style caching to a full mongodb instance? The redis (live) to mongodb (persist) route looks daunting...

    JB

  • 0 Votes
    1 Posts
    2k Views

    Well, I have this issue that I need to do following things:
    1.Mongo Find
    2. Foreach
    3. MongoFind
    4 one more Foreach.

    because of asynchronaus mongo calls it is difficult to get proper result, however process.nextTick should handle this problem and still I have problem:

    function find(dbComm) {

    dbComm.forEach(function (current) { id= parseFloat(current.ID); db.anotherCollection.find({ ID: id}, function (error, result) { result.forEach(function (rank) { if (parseFloat(result.ID) == parseFloat(current.ID)) { rank.rank = 'Some calculations'; } }); }); });

    }

    app.get('/someparams', function (req, res) {

    db.collection.find().sort({ "rank": order }).skip(pagenumber).limit(5, function (err, result) { process.nextTick(function () { find(result, function () { }) }); process.nextTick(function () { res.send(result); }); });

    And on client side I should recive an array where the rank equals 'Some Calculations'
    but unfortunetly it is not...
    However...! If I add setTimeout(function(){}) before res.send(result) (and res.send(result) will be placed inside setTimeout) it actually does work and on client side I recive data with "Some Calculations" but it is just timeout and it fails sometimes and client dont recive "Some Calculations"
    if I put process.nextTick instead of setTimeout it doesnt work and "Some calc..." are not sent.

    Something is beeing done eralier then it should (probably in forEach in find() function)
    and my question is how to deal with it? maybe I should put process.nextTick in different function ?