SOLVED Noobie Question: How to access the automatically backed up system config db in the system dataset?!

Status
Not open for further replies.

Cocksy

Dabbler
Joined
Apr 8, 2018
Messages
32
Hi All,

I'm still learning my way round FreeNAS in my test VM. I'm currently making sure I know what to do if i have to recover the system from some kind of failure. Reading the forum, I'm aware that FreeNAS makes an automatic backup of the config db on the system dataset every morning at 03:45, which is excellent. So, I'm trying to work out how I would recover that file if I had to rebuild the boot drive, and recover from the system dataset backup db.

SSH'ing in, I can see the following from zfs /all:
Code:
[root@freenas2 ~]# zfs list																										 
NAME																		 USED  AVAIL  REFER  MOUNTPOINT						 
Backup																	   679M  16.7G	88K  /mnt/Backup						
Backup/Media																 666M  16.7G   666M  /mnt/Backup/Media				 
Backup/Pictures															 12.1M  16.7G	12M  /mnt/Backup/Pictures			   
Backup/UrBackup															   88K  16.7G	88K  /mnt/Backup/UrBackup			   
PretendSSDforJail														   1.48G  8.15G	88K  /mnt/PretendSSDforJail			 
PretendSSDforJail/Jail													  1.48G  8.15G  83.2M  /mnt/PretendSSDforJail/Jail		
PretendSSDforJail/Jail/.warden-template-pluginjail-11.0-x64				  539M  8.15G   539M  /mnt/PretendSSDforJail/Jail/.warden
-template-pluginjail-11.0-x64																									   
PretendSSDforJail/Jail/.warden-template-pluginjail-11.0-x64-20180812204057   539M  8.15G   539M  /mnt/PretendSSDforJail/Jail/.warden
-template-pluginjail-11.0-x64-20180812204057																						
PretendSSDforJail/Jail/plexmediaserver_1									 350M  8.15G   865M  /mnt/PretendSSDforJail/Jail/plexmed
iaserver_1																														 
TestVolume1																 1.16G  14.2G	88K  /mnt/TestVolume1				   
TestVolume1/.system														  512M  14.2G	96K  legacy							 
TestVolume1/.system/configs-c0708eef149b49a396f66530a6f1b80a				 608K  14.2G   496K  legacy							 
TestVolume1/.system/cores													564K  14.2G   508K  legacy							 
TestVolume1/.system/rrd-c0708eef149b49a396f66530a6f1b80a					  88K  14.2G	88K  legacy							 
TestVolume1/.system/samba4												   528K  14.2G   236K  legacy							 
TestVolume1/.system/syslog-c0708eef149b49a396f66530a6f1b80a				   88K  14.2G	88K  legacy							 
TestVolume1/Media															666M  14.2G   666M  /mnt/TestVolume1/Media			 
TestVolume1/Pictures														12.1M  14.2G	12M  /mnt/TestVolume1/Pictures		 
freenas-boot																1.66G  6.03G	64K  none							   
freenas-boot/ROOT														   1.64G  6.03G	29K  none							   
freenas-boot/ROOT/11.1-U6												   1.64G  6.03G   840M  /								 
freenas-boot/ROOT/Initial-Install											  1K  6.03G   837M  legacy							 
freenas-boot/ROOT/Wizard-2018-08-12_08:46:22								   1K  6.03G   837M  legacy							 
freenas-boot/ROOT/default												   2.14M  6.03G   839M  legacy							 
freenas-boot/grub														   6.84M  6.03G  6.84M  legacy							 
[root@freenas2 ~]#

So, I think that the backup db's are in "TestVolume1/.system/configs-c0708eef149b49a396f66530a6f1b80a", however for the life of me I can't work out how to access that area and copy / move / see the db file there! I'm very comfortable using a DOS command prompt, and Powershell to a lesser extent, but the FreeBSD commands and my understanding of the system are still quite lacking, and google / forum search isn't turning up the right results - probably as I'm not using the right terminology for FreeBSD.

I think that I cannot access that directory because it is under a "legacy" mountpoint, but I can't work out how to mount it, let alone copy the db either to the right place on the FreeNAS boot drive/pool, or download it to my client PC to then upload it using the GUI. Maybe I can't mount it as its in use by the system, as my system is up and running OK? Possibly clutching at straws here...!

I'm guessing this is actually a really easy thing to do, but I just can't work out the right commands. I'd be really grateful if someone could help point me in the right direction!! Many TIA.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,456
TestVolume1/.system/configs-c0708eef149b49a396f66530a6f1b80a
That's the pool/dataset that holds them. It's mounted in your system as /var/db/system/configs-c0708eef149b49a396f66530a6f1b80a. In there, you'll see directories for each version of FreeNAS you've had installed. In those directories, you'll find the individual config file backups.
 

Cocksy

Dabbler
Joined
Apr 8, 2018
Messages
32
Thank you so much @danb35 !

As I'm looking in that directory, i can only see one file, as I upgraded the server to U5 earlier - I presume all the backups from U4 have been deleted? Worth noting that down so that I make a manual backup before any upgrade....

Secondly, if I did need to restore a db file, how do i go about either:
a) downloading it to my client PC (to then upload back to FN via the GUI)
or
b) copying it to the right location for FN to pick up on the next boot?

Cheers.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,456
presume all the backups from U4 have been deleted?
They shouldn't have been:
upload_2018-8-23_18-26-2.png

a) downloading it to my client PC (to then upload back to FN via the GUI)
I'd probably use scp, as it doesn't rely on any configured sharing protocols (just SSH access to the machine). I know there are Windows clients, but since I don't use Windows much, I'm not familiar with them. I just use the terminal on my Mac: scp root@freenas2:/var/db/system/configs-03dfc785c4b1491e8f0739ff94ed3f4b/FreeNAS-11.1-U5/20180823.db .
 

Cocksy

Dabbler
Joined
Apr 8, 2018
Messages
32
They shouldn't have been:
View attachment 25327

Interesting, mine doesn't have the old config files in that directory; I'll see if I can grab a screenshot / list from there later to share. I'll also check my other VM to see if that one has any previous ones too.

Sent from my SM-G920F using Tapatalk
 

Cocksy

Dabbler
Joined
Apr 8, 2018
Messages
32
Interesting, mine doesn't have the old config files in that directory; I'll see if I can grab a screenshot / list from there later to share. I'll also check my other VM to see if that one has any previous ones too.
cancel my last; the previous configs are in that folder! My bad!

I'm guessing the daily config backup overwrites the previous one when it backs up at 0345, seeing as both you and I only have one version of each?
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,456
I'm guessing the daily config backup overwrites the previous one when it backs up at 0345, seeing as both you and I only have one version of each?
No, each of those is a directory, and contains the backup from each day it's been run.
 
Status
Not open for further replies.
Top