Looking for a complete backup solution
-
I am looking for a complete backup solution for my NodeBB forum. I am running the forum on a Linux server, I donβt think backing up the whole virtual machine is in the cards, so I am looking for a script solution. Here is the summary of what I am looking for in a backup solution:
- Take daily full backups of nodebb
- Upload the backup to another server
- Ability to quickly restore the full backup (in minutes) on any server
I have looked at some existing discussions like any backup plugin?, redis backup and Upgrade docs. But I have not found a complete answer yet.
This is what I think a full daily backup should contain:
- all discussions (full database)
- all images and uploaded files
- all installed plugins
Is there anything else that should be in the full backup to include any other customization/modifications to NodeBB?
Now I understand why a backup solution is not implemented as part of ACP or a plugin. To be honest I dont think NodeBB itself would have to solve this issue, as backing up installation can be different depending on the environment you are running it. However, I think in cases like mine something can be done as a script or event better wrapped in an npm module. Does anyone has a solution along this line that they are willing to share?
ps: this is the only thing I need to solve before moving my community mailing list to our brand new NodeBB powered site
-
Steps to backup Redis and images can be found here
If you use Digital Ocean, their snapshot feature can be automated via their API.
Note: For snapshot to work, your server needs to be switched off. To backup Redis, you will need to run BGSAVE or some data may not be saved into the dump.rdb file.
-
Backing up mongodb/redis...?
I am using redis
Steps to backup Redis and images can be found here
Thanks mate, but I already linked to that doc page in my post
I am not using a server that support VM snapshots.
Any other suggestions for regular full backup with all images and customization?
-
@arasbm personally, I just run a cronjob to export the db, and upload it directly to tarsnap. We'll worth the money, in my opinion!
Contact us at [email protected] and we can help you install a backup script in your server.
-
@julian this is for a non profit group and we have no funding right now, otherwise I would love to pay for support or even use your hosting service.
I just run a cronjob to export the db
What about images and plugins? My understaning is that the db only has the text of posts, right?
-
I posted a script that i use for MongoDB that is very useful for doing backups. Setting it as a cron job and let it run every day.
You could create a script or modify the MongoDB one to backup the whole of NodeBB too, then another script to use rsync or some other program to upload it to another server.
Cron job it all and you would have a fully working remote backup.
I have no experience with redis backup though, sorry
https://community.nodebb.org/topic/2039/any-backup-plugin/6 - post a link to the script there.
-
Cronjob sounds great. I would use the S3 to store the backup files.
For backing up the site, I'd use 2 different solutions. Daily DB backup with Cronjob, and another one is instance snapshot. Installed NodeBB on a Docker instance, and what I need to do is that commit the instance once a week, output it as
.tar
file, store it somewhere reliable.For image assets, I prefer offshore storage like the S3, so the instance snapshot won't be really big in size..