I have not tested this yet:

https://www.cyberciti.biz/faq/howto-backup-freenas-configuration-file-restore-it/