How to document all settings

Is there a way to document all the settings in FreePBX?

I know you can do a backup, but if a setting gets changed it would be ideal to be able to refer to what it used to be without having to restore the whole system.

Asterisk is a hodgepodge of data structures which FreePBX compounds . There are essentially three databases you need to concern yourself with, Asterisk maintains it’s ‘state’ in a sqlite3 database at /var/lib/asterisk/astdb.sqlite3 but the voicemail is inherited from ‘comedian mail’ which uses a flatform text file at /etc/asterisk/voicemail.conf. To complicate matters, FreePBX stores it’s stuff in ‘mysql’ databases at /var/lib/mysql.

So ‘backups’ in this eco-system package need to ‘serialize’ all this stuff and restoring needs to ‘de-serialize’ it.
It is probably not worth your effort to try and reinvent this wheel. but if you want

#!/bin/bash
fwconsole  -x 'database show'
cat /etc/asterisk/voicemail.conf
mysql dump asterisk
mysqldump asteriskcdrdb

would give you the raw data you ask for. If you did that in a timely fashion, the linux’ "diff " command against any two instances of that output would identify changes (not in an easily readable format though)

If you use diff -U 1000, or some suitably higher number, it should show the whole text with added and deleted lines marked. You could also use Gnu wdiff to highlight individual changed “words”.

be warned, mysql lines are ‘very long’

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.