Restoring/Upgrading nodeBB - Procedure

  • I'm testing restoring nodeBB after a reboot on my server or a crash for example.

    I set up redis with the default config:

    I start nodeBB
    -./nodebb start

    This doesn't work, I have to run ./nodebb setup before ./nodebb start or the forum just show the top bar
    After a setup, I can start the forums fine but it is a fresh new forums, seems like it did not load dump.rdb from redis. I lost all my categories and settings in nodeBB. Where is the category and settings saved on nodeBB? does running a "setup" overwrite them?

    I would really like to be able to save Redis database and be able to restore it before thinking of going in production with nodeBB.
    Is there a guide available because I followed the "update" procedure but seems like I'm missing something

    Seems to have found the correct procedure, problem was I started Redis-server in a different location so the dump.rdb was not in /var/lib/redis like it should have been

    1- Save redis-server latest db
    redis-cli save
    2- shutdown nodeBB and redis-server
    ./nodebb stop
    redis-cli shutdown
    3- backup the corresponding dump.rdb file (location will be where you started redis-server)

    1- Delete old dump.rdb if present
    2- upload good dump.rdb
    3- start redis-server at the location where dump.rdb is
    cd [location_of_dump.rdb]
    4- start nodebb
    ./nodebb start

  • Community Rep

    @maximus123 said:

    1- Save redis-server latest db
    redis-cli save

    redis-cli bgsave is a better one for you, I believe.

    restoring nodeBB after a reboot on my server or a crash for example

    Why wouldn't you add NodeBB as a daemon? It's a good practice for production. Simply let your kitten to make a proper file in /etc/init.d/ (if debian-like linux)

    does running a "setup" overwrite them?

    No, it doesn't overwrite anything except config.json. It just makes categories if they are not exists yet.

  • Thanks Mega, I'm a newbie on Linux (just starting using CentOS on a VPS).
    As of right now after a system reboot I have to manually start redis-server then nodeBB.
    Will look for ways to automate that 😉

    Also probably not good to start redis-server with the default config?
    What would be the best way to start redis so that the dump.rdb is always loaded/saved from the same spot? Thanks!


  • GNU/Linux Admin

    @maximus123 When you run redis, it reads a configuration file to know what to do. In Ubuntu, this default file is located at /etc/redis/redis.conf.

    In this file is defined where the dump.rdb file is saved. Probably the dir option.

    If you run Redis the same way each time, the location of dump.rdb should not change.

    Also nice to know: Make sure redis is shut down before removing/replacing dump.rdb, otherwise when you restart/stop redis, it will just overwrite your new dump.rdb with the database in memory!

  • @julian

    Thanks for the tips! However, it seems starting redis-server without a .conf file just create the dump.rdb in the same folder you start Redis (using Redis 2.8.19)
    I had to redownload the redis.conf for 2.8.19, and can now start redis-server with the conf file in argument, I added the db path under "SNAPSHOTTING" in the redis.conf


Log in to reply

Suggested Topics

| |