Recreating nodeBB forum on new server

Technical Support
  • Hi,

    I have this forum: http://howardmann.us:4567 on a Digital Ocean droplet.

    I'm going to create a new Droplet, install NodeBB on it, and then simply re-create the forum.

    I have a backup (a dump.rdb) of the Redis database on my laptop, and guidance for restoring this.

    I presume I'll have to restore/replace the contents of other, certain directories— X, Y, Z, etc. — from the contents of the same saved directories on my laptop in order to achieve this.

    Which directories do I need to save and replace ?

    Or, is there a better method (before I ultimately destroy my current Droplet), or guidance, for achieving this ?

    Thanks!

    Howard

  • You will need the public/uploads folder for uploaded files. If you installed plugins into node_modules without adding them to package.json you will have to reinstall those as well.

  • @baris

    Thanks!

    I don't recall "adding" the plugins (Imgur; and Sendmail) to package.json. I don't know what that process is. If you tell me what I should see in package.json that would clarify this, I'll look at it.

    I do, of course, have the API key , ClientID and secret for the plugins I do want: Imgur and Sendmail.

    Any guidance is appreciated 🙂

    Howard

  • You don't have to worry if you installed them through the ACP page, just copy your files to the new server and it should work. I was referring to plugins that might be sysmlinked into the node_modules folder. Your keys and secrets are stored in the database for the plugins so copying the plugin will bring those back as well.

  • @baris

    Yes, I installed them via the Administrator page.

    I presume you mean the two plugin-related folders in: "node_modules."

    If not, let me know. Otherwise, I'll do that and report back later this weekend.

    Thanks.

    Howard

  • @howardm if they're installed from the ACP you're fine. Don't worry about copying anything. If you check the "dependencies" list in package.json for the two plugins, you can double check they're there.

    It doesn't really matter if they're there, though. You can always reinstall them from the ACP.

  • @pitaj @baris

    Follow-up:

    I installed nodebb in my home folder. (It's in /var/www on my current server. I'm not sure why I put it there. I presume it doesn't matter where it is.)

    I first renamed the present dump.rdb file to "dump.rdb.old." I then copied the saved dump.rdb file to redis on my new server. This proceeded without an error. I changed the permissions of /var/lib/redis and the dump.rdb file appropriately. I then restarted redis and nodebb.

    I didn't try to move over the plugins (Imgur; and Sendmail) I mentioned above.

    Unfortunately, the result looks like this: http://192.241.201.15:4567

    Instead of like this: http://howardmann.us:4567

    How do I begin to troubleshoot the result ? Does the appearance of the page suggestive of some particular issue ?

    Here is the contents of config.json:


    {
    "url": "http://192.241.201.15:4567",
    "secret": "thesecret",
    "database": "redis",
    "redis": {
    "host": "127.0.0.1",
    "port": "6379",
    "password": "thecorrectpassword",
    "database": "1"
    },
    "type": "literal"
    }


    I don't see the "type": "literal" in config.json on my current server. I don't know what this is.

    Thanks!

    Howard

  • Try running ./nodebb build and restarting.

  • @pitaj said in Recreating nodeBB forum on new server:

    ./nodebb build


    Thanks. I did this. Here is the output:

    $ ./nodebb build
    started
    2018-02-25T23:55:01.182Z [16547] - info: [build] Building in parallel mode
    2018-02-25T23:55:01.185Z [16547] - info: [build] plugin static dirs build started
    2018-02-25T23:55:01.190Z [16547] - info: [build] requirejs modules build started
    2018-02-25T23:55:01.192Z [16547] - info: [build] client js bundle build started
    2018-02-25T23:55:01.194Z [16547] - info: [build] admin js bundle build started
    2018-02-25T23:55:01.197Z [16547] - info: [build] client side styles build started
    2018-02-25T23:55:01.199Z [16547] - info: [build] admin control panel styles build started
    2018-02-25T23:55:01.217Z [16547] - info: [build] templates build started
    2018-02-25T23:55:01.218Z [16547] - info: [build] languages build started
    2018-02-25T23:55:01.219Z [16547] - info: [build] sounds build started
    2018-02-25T23:55:01.225Z [16547] - info: [build] plugin static dirs build completed in 0.04sec
    2018-02-25T23:55:07.666Z [16547] - info: [build] client js bundle build completed in 6.474sec
    2018-02-25T23:55:07.666Z [16547] - info: [build] admin js bundle build completed in 6.472sec
    2018-02-25T23:55:07.800Z [16547] - info: [build] sounds build completed in 6.581sec
    Witout from option PostCSS could generate wrong source map or do not find Browserslist config. Set it to CSS file path or to undefined to prevent this warning
    2018-02-25T23:55:14.231Z [16547] - info: [build] client side styles build completed in 13.034sec
    2018-02-25T23:55:17.727Z [16547] - info: [build] admin control panel styles build completed in 16.529sec
    2018-02-25T23:55:17.848Z [16547] - info: [build] requirejs modules build completed in 16.658sec
    2018-02-25T23:55:19.498Z [16547] - info: [build] languages build completed in 18.28sec
    2018-02-25T23:55:19.519Z [16547] - info: [build] templates build completed in 18.302sec
    2018-02-25T23:55:19.521Z [16547] - info: [build] Asset compilation successful. Completed in 18.336sec.
    howardm@UbuntuFebruary2018:~/nodebb$ ./nodebb restart


    Unfortunately, the result is the same: http://192.241.201.15:4567

    Howard

  • @howardm It looks like your database didn't copy over correctly.

  • @pitaj

    Thanks for responding. I used scp to copy it (dump.rdb) directly from server 1 to the home directory of server 2, and then (using cp) from the home directory to /var/lib/redis.

    It's a small file (small database) and I didn't see any errors.

    Could this method have introduced "corruption" ?

    What method would you use ?

    Howard

  • @howardm If I were you, I'd check that the redis database is correct using redis-cli. By viewing the contents of keys like config or plugins:active you can make sure you have the right database settings. You also might want to check that "database": 1 is what you want, as the default is 0 for redis.

  • @pitaj

    Well, that was it!

    I changed the config.json to read: "database": "0" and it works.

    When I installed nodebb,the setup (I think) said I could choose any database number, and I arbitrarily chose "1" without thinking that the redis database I was going to restore was (presumably) associated with "0". Or, stated differently, there is only one redis database involved in this situation.

    Thanks, again, for the observation!

    Howard

  • Glad to hear you're up and running @howardm 😄


Suggested Topics


  • Using NodeBB with MySQL

    Technical Support
    0 Votes
    3 Posts
    2k Views

    By default, it's no possible to use mysql directly. But if you really want it, some efforts could be take to migrate the db from existing dbs to mysql database.

    So, in short, it's possible to use mysql only if you can successfuly migrate all schemas and existing database operations in the code from mongodb/redis/postgresql(any of these) into mysql.

  • 0 Votes
    8 Posts
    4k Views

    @scuzz said in Moving a NodeBB mongo DB from one server to another.:

    Once the database has been restored correctly you can run the NodeBB installer.

    When it asks for the database you will just tell it the database name of the database you just restored.

    This should then install NodeBB with your old database.

    Yes, this has worked for me as well.

    Making a backup of the nodebb database on the old server, for example:

    mongodump -u nodebb -p [password] -d nodebb -o dump/nodebb-2018-03-30

    Restoring the nodebb database from that backup, after copying it to the new server:

    mongorestore -u nodebb -p [password] -d nodebb dump/nodebb-2018-03-30/nodebb/

    And then installing NodeBB on the new server.

  • 0 Votes
    3 Posts
    2k Views

    I rolled back to mongo 3.0.8 and that seems to have fixed it for now.

  • 0 Votes
    11 Posts
    4k Views

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

  • 0 Votes
    2 Posts
    2k Views

    For 1 I would be inclined to use clustering then reverse proxy the subdomains to categories. Rather than spooling individual instances for each. I've done this at my own site.

    dnb.35hz.co.uk will take you to the electronic category.

    You could then make a few changes to how your homepage/main website looks and do it that way.

    As an additional. Anything you're not sure exists, drop an email to sales [at]nodebb.org and they may be able to create what you need.