Export configuration via command line

Status
Not open for further replies.

John Healey

Cadet
Joined
Jun 21, 2015
Messages
3
Hi. I have been suffering the same issue as described in the thread,

Can't upgrade through GUI or download config to update manually

I have tried the resolution proposed there - backing up and restoring the config database at /data/freenas-v1.db, but unfortunately the issue recurs after I restore the database. Is there any way to export the configuration via the command line, rather than the web gui? I have basic shell scripting skills and access to a shell via PuTTY.

Many thanks.
 

Bidule0hm

Server Electronics Sorcerer
Joined
Aug 5, 2013
Messages
3,710
The .db is the config so you've already exported/imported it via the shell.

If there's still a problem then it's not because of that.
 

gpsguy

Active Member
Joined
Jan 22, 2012
Messages
4,472
In addition to what BiduleOhm said, you could do an integrity check on the configuration file.

Search the forum for "sqlite3 freenas-v1.db" for the syntax.

I can't type it on my phone.


Sent from my phone
 

John Healey

Cadet
Joined
Jun 21, 2015
Messages
3
Thanks gpsguy. I found the syntax here.

https://forums.freenas.org/index.php?threads/cifs-dead-in-the-water.35044/#post-211520

It was then a process of dumping the databases via,

% sudo sqlite3 freenas-v1.db ".dump" > freenas-v1.txt
% sudo sqlite3 factory.db ".dump" > factory.txt

And then comparing them line by line to find the missing or outdated CREATE TABLE statements, mismatched INSERTS etc.

Finally I could reimport using the following (over several iterations to remove any errors)
% sudo more freenas-v1.txt | sudo sqlite3 fixed.db

Then finally,
% mv freenas-v1.db freenas-v1.db.bad
% mv fixed.db freenas-v1.db
% sudo shutdown -r now

I am now able to get back into the GUI and all of the settings appear to be correct.

Thanks for your help.
 
Status
Not open for further replies.
Top