Issue with permissions, import, legacy



  • Hi,

    I have imported my users, topics and posts from my legacy forum within nodebb.
    Everything sounded good, but my legacy users are not able to see any content while connected
    As a temporary fix, I have added them to a special group (legacy) that fixed the issue.

    My question is, is there anyone able to give me hints on the type of record I obviously miss during my "import" ?

    What I have populated for each user:

    {"_key":"user:<uid>"}
    {"_key":"username:uid"}
    {"_key":"username:sorted"}
    {"_key":"userslug:uid"}
    {"_key":"users:joindate"}
    {"_key":"email:uid"}
    {"_key":"email:sorted"}
    {"_key":"group:registered-users:members"}
    

    For the topics (I inserted each topic in an existing category - 2)

    {"_key":"topic:<tid>"}
    {"_key":"topics:tid"}
    {"_key":"cid:2:tids"}
    {"_key":"uid:<uid>:topics"}
    {"_key":"cid:2:<uid>:tids"}
    

    For posts

    {"_key":"post:<pid>"}
    {"_key":"posts:pid"}
    {"_key":"group:administrators:member:pids"}
    {"_key":"uid:<uid>:posts"}
    {"_key":"tid:<tid>:posts"}
    


  • I finally found the issue, it is related to the timestamp (score) when the user get registered.
    I did not realized that my import was generating wrong type of time stamp {score":{"$numberLong":"1454992330000"}} rather than {score":1.509408313172e+12}

    I finally run this fixup to cope with my issue:

    db.objects.find({_key:"group:registered-users:members"}).forEach(
      function(e){
        db.objects.update(
          {"_id": e._id},
          {"$set": {"score": 0+e.score}}
        )
      }
    );
    

    I hate this mongojs thingy 😤


 

Suggested Topics

| |