Setting up a new instance of NodeBB with old database?



  • Hey,

    When trying to update my forum to 0.7.1, my nodebb broke (Not sure if it was my fault or nodebb, I followed the same steps as I did when upgrading before). So I was wondering if I could use a MongoDB backup to keep at least the posts that were made on my forum into a new instance of NodeBB, since there's no way I'll figure out how to save the current forum, and I don't wanna bother someone to fix it for me. Is it as simple as setting up a new NodeBB and replacing the database with the backup after its running?

    Thanks!

    Other info:
    Ubuntu 14.04 on Digital Ocean VPS
    Mongo 3.0.4
    Nodejs 0.12.5
    Broke when updating from NodeBB 0.7.0 to 0.7.1


  • Translator

    If i were you i would restore the database with the backup and try to do the upgrade again. Maybe you can figure out what was worng the first time and do it properly.

    I would say it is better not to mix bbdd and code versions, it could be so wrong.

    Regards.



  • There was all sorts of issues with NodeBB after I upgraded. My NODE_PATH was set to nothing, and after I set it back to the correct path it couldn't find any of the npm dependencies, and also it broke my MongoDB (Can't run it anymore, gives me this error:)

    Error: couldn't connect to server 127.0.0.1:27017 at src/mongo/shell/mongo.js:145
    exception: connect failed
    

    So I can't really run the upgrade again.

    If anyone is up for the task of fixing the mess I made, I guess I can offer $10 or $20 if you can restore it to where it was before.

    Thanks



  • @Juxtapo, is MongoDB running? That error indicates that it's not.

    Determine its status by typing

    sudo service mongodb status
    

    If it's not running, start it:

    sudo service mongodb start


  • After entering mongod start, it instantly shuts itself off

    root@alpine:~# service mongod status
    mongod stop/waiting
    root@alpine:~# service mongod start
    mongod start/running, process 4339
    root@alpine:~# service mongod status
    mongod stop/waiting
    

  • Community Rep

    @Juxtapo Try looking at the logs for mongo, that's usually an indicator that something crashed. You can also check if there's already a process running that got in a bad state by entering the command ps aux | grep mongo



  • @Juxtapo, Lokk though the NodeBB logs using:

    sudo ./nodebb log
    


  • @BDHarrington7 said:

    @Juxtapo Try looking at the logs for mongo, that's usually an indicator that something crashed. You can also check if there's already a process running that got in a bad state by entering the command ps aux | grep mongo

    Nothing has crashed, I restarted the VPS too and same issue. In the logs its giving me "Data directory /data/db not found", and I set the dbpath to the proper location but it isn't actually changing anything

    @finid The main issue I need to fix right now is the database, I can't do anything with nodebb until the database is working properly.

    Does anyone know if there is a way I can setup a new nodebb with my existing Mongo database? I feel like that would be much easier than repairing my Mongo and then repairing nodebb.



  • @Juxtapo

    The main issue I need to fix right now is the database, I can't do anything with nodebb until the database is working properly.

    But running that command will likely tell you why the application is not connecting to the DB...

    The fix, once the cause is determined, will likely be easier than a fresh install



  • @finid said:

    @Juxtapo

    The main issue I need to fix right now is the database, I can't do anything with nodebb until the database is working properly.

    But running that command will likely tell you why the application is not connecting to the DB...

    The fix, once the cause is determined, will likely be easier than a fresh install

    I can't even start the database on its own. A fresh install is very easy, would take under 30 minutes, and then if it is possible, I'm sure merging the old database isn't too hard.


  • Admin

    @Juxtapo What do the MongoDB logs suggest is the problem?


 

| |