OPNsense Forum

Archive => 22.7 Legacy Series => Topic started by: FullyBorked on October 05, 2022, 09:12:20 PM

Title: Options for automatic backup?
Post by: FullyBorked on October 05, 2022, 09:12:20 PM
What is everyone using for automatic backup?  I tried Nextcloud but was unsuccessful so I gave up https://forum.opnsense.org/index.php?topic=30298.msg146206#msg146206 (https://forum.opnsense.org/index.php?topic=30298.msg146206#msg146206).  Google drive isn't ideal, it feels pretty janky and overly complex in my opinion.  Is there an option for FTP, SFTP, or SMB that I'm just not seeing or a plugin to enable it?  I also saw a way to pull backups via an API but I really don't like that option either, that requires scripting that is over my head as well.   8)
Title: Re: Options for automatic backup?
Post by: Patrick M. Hausen on October 05, 2022, 09:24:12 PM
The plugin os-git-backup is great. It will commit all your changes to git. And if you have several administrators and use a dedicated account for each individual, it even logs who made which change in the commit message.

You can use the XML config file that ends up in the repo to restore your configuration to a completely new installation.

A single caveat: the saved config contains everything. Passwords/secrets etc. included. So do not push your configs to github. ;) Use a strictly private repository.

@work my company runs a private installation of gitlab and all our firewalls push their config changes to a repository only administrators have access to. @home I run a private installation of Gitea.
Title: Re: Options for automatic backup?
Post by: FullyBorked on October 05, 2022, 09:31:12 PM
Quote from: pmhausen on October 05, 2022, 09:24:12 PM
The plugin os-git-backup is great. It will commit all your changes to git. And if you have several administrators and use a dedicated account for each individual, it even logs who made which change in the commit message.

You can use the XML config file that ends up in the repo to restore your configuration to a completely new installation.

A single caveat: the saved config contains everything. Passwords/secrets etc. included. So do not push your configs to github. ;) Use a strictly private repository.

@work my company runs a private installation of gitlab and all our firewalls push their config changes to a repository only administrators have access to. @home I run a private installation of Gitea.

I'll look into this option, I've never spooled up a private git server.  Do you have a preferred guide for a git beginner :) .  We used bitbucket at my previous job, but not for this type of backup.  My firewalls there all supported SMB so I just sent backups to a share. 
Title: Re: Options for automatic backup?
Post by: Patrick M. Hausen on October 05, 2022, 09:47:27 PM
Look into Gitea. It's lightweight and dead easy to set up. I'm a FreeBSD guy so I run it in a jail with manual installation. I am confident there are APT repos or ready-made Docker images available.

https://gitea.io/en-us/
Title: Re: Options for automatic backup?
Post by: Inxsible on October 05, 2022, 10:23:52 PM
Quote from: FullyBorked on October 05, 2022, 09:12:20 PM
What is everyone using for automatic backup?  I tried Nextcloud but was unsuccessful so I gave up https://forum.opnsense.org/index.php?topic=30298.msg146206#msg146206 (https://forum.opnsense.org/index.php?topic=30298.msg146206#msg146206).  Google drive isn't ideal, it feels pretty janky and overly complex in my opinion.  Is there an option for FTP, SFTP, or SMB that I'm just not seeing or a plugin to enable it?  I also saw a way to pull backups via an API but I really don't like that option either, that requires scripting that is over my head as well.   8)

I use my local nextcloud server for it. What kind of problems did you get -- I'll look at your other thread and see if I can help.

Too much trouble to set up an entire git server just for opnsense backups. Another option would be to simply do a copy of your config to a shared drive or a NAS in a script and set it to run based on a cron job.
Title: Re: Options for automatic backup?
Post by: Patrick M. Hausen on October 05, 2022, 10:45:04 PM
Quote from: Inxsible on October 05, 2022, 10:23:52 PM
Too much trouble to set up an entire git server just for opnsense backups. Another option would be to simply do a copy of your config to a shared drive or a NAS in a script and set it to run based on a cron job.
Agree. I run gitlab/Gitea for various repos so it was a natural choice for OPNsense backups.

For a simple scripted download of the configuration there's the os-api-backup plugin. I did use that before moving everything to git. Works great.