Created a NodeBB-Backup tool - Request For Feedback


  • Plugin & Theme Dev

    I saw that version 0.8.0 was released. This is my second upgrade and I realized I should have a quick way to consistently run backups that would record the version that was backed up and time of the backup. I'm still new to Node.js and NodeBB so I thought I'd do it as a globally installable npm tool.

    After installing the tool (npm install -g nodebb-backup) you just run it from your nodebb installation directory:

    nodebb-backup

    The version number captured is from package.json and the mongo info (yes, mongo only right now) is loaded from config.json. As described in the upgrade docs for NodeBB (https://docs.nodebb.org/vi/latest/upgrading/) it dumps the db and saves the /uploads directory. The db dump and /uploads copy are compressed into a tar named like this:

    nodebb-backup-2015-09-01_2236-v0.7.3.tar
    (which is saved to the directory above your nodebb install)

    If this is useful to you, could you review the code and let me know if you think it is doing the right thing? Also, there are a number of additions that I think would be useful:

    • Be able to provide a path to place the resulting back up file
    • Redis support
    • Maybe be able to restore from a provided tar file?

    Anything else? Thanks for looking.

    Github: https://github.com/jongarrison/nodebb-backup
    Npm: https://www.npmjs.com/package/nodebb-backup


  • Translator

    Great work. I think this would be more than useful to a lot of the users.


  • Plugin & Theme Dev

    Cool, well it will be interesting to see if it gets used.


  • Admin

    Nice idea. Maybe if you end up supporting both databases and also maybe a restore from backup option, it would be a cool plugin 🙂


  • Plugin & Theme Dev

    sounds very good to me
    posible enhancements?

    • maybe a cron to autorun all days or every hour etc
    • option to remove old backups from x days
    • scp copy to another server
      -backup only db and not assets

    good job


  • Plugin & Theme Dev

    Hmm, yeah it would make sense as a full admin plugin with those other features. I'll put those features on the list.

    Why you would only want the db without assets? The system isn't complete without both, right?


  • Plugin & Theme Dev

    @jongarrison said:

    Hmm, yeah it would make sense as a full admin plugin with those other features. I'll put those features on the list.

    Why you would only want the db without assets? The system isn't complete without both, right?

    assets its uploaded avatars , uploaded files if enabled and stuff, right?
    maybe you want to save db each hour but you only want to save assets 1 time a day
    also if you use imgur maybe no need for assets backups
    just and idea anyways


  • Plugin & Theme Dev

    @exo.do yeah, that makes sense to just get the critical stuff frequently.

    Thanks for the feedback!


  • Community Rep

    I just wonder, whether someone is interested in a guide of automatic incremental backing up NodeBB using rsnapshot on Linux-based servers? I mean not a tool, but a guide only. Because I have no intention yet to make neither the tool nor to contribute to the nodebb-backup tool.

    And if I'll make the guide someday, it probably will be not for complete newbies, but for those who's able to (at least):

    1. use terminal
    2. completely understand what chown and chmod commands are for, and what * * * * * in cronejobs mean

    p.s. When you're using rsnapshot, there is almost no difference which database you're using, Redis or MongoDB.


  • Admin

    We're always happy to accept new contributions to our docs 🙂


  • Admin

    Yes, if we have 2 or more different backup strategies, we could have a whole section on backups for NodeBB...


Log in to reply
 


Looks like your connection to NodeBB was lost, please wait while we try to reconnect.