How to backup jails and configurations

phier

Patron
Joined
Dec 4, 2012
Messages
400
@Patrick M. Hausen thanks!


still not clear .. whats the best architecture how to borg-out data from Truenas ... to create a jail for a borg... or to run borg within jails etc.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
What's a borg in this context?

Create a recursive periodic snapshot task for <pool>/iocage/jails.
Create a replication task to a second system based on that snapshot task.
Define snapshot frequency and retention as you see fit.

Backup done.
 

phier

Patron
Joined
Dec 4, 2012
Messages
400
What's a borg in this context?

Create a recursive periodic snapshot task for <pool>/iocage/jails.
Create a replication task to a second system based on that snapshot task.
Define snapshot frequency and retention as you see fit.

Backup done.
thats backup on zfs level, correct? so both endpoints has to have zfs etc...

borg is file level backup ... so these are different approaches and still confused how to approach it and which way to go or if somehow to combine both of these could be beneficial?

for example someone is trying to do something similar here> https://www.runby.coffee/backing-up-truenas-with-borg
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
One runs a NAS based on ZFS to reap ZFS' benefits. ZFS replication is THE way to backup data residing on ZFS. Why would one do anything else? I cannot assist in any method but that. I run hourly replications between two heavy production machines, daily replication of all my private data ... that's why I use ZFS!

Outside of the TrueNAS context we run roughly 1000 customer jails on 100 servers in our own hosting platform. All of them are snapshotted and replicated each night to central storage systems running FreeBSD and ZFS just like the hosting servers do.
 

piezanno

Cadet
Joined
Apr 2, 2021
Messages
1
This is built into iocage. After shutting down the jail, run iocage export <name of jail>, and the jail will be saved as a TAR file under /mnt/<your pool name>/iocage/images. If you need to rebuild your jail, you can run iocage destroy <name of jail> and then iocage import <name of jail>, which will rebuild the jail from the previous export.
Thanks for this: Are there also commands to back up plugins and / or virtual machines?
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
For virtual machines just do a snapshot and replication of the zvol containing the virtual disk. You can do the same for jails, actually - perform a recursive snapshot and replication for <pool>/iocage/jails and you have a backup of all your jails and plugins.
 
Top