Where are the client portal settings stored (SSH backup/restore)

We failed over to a secondary server last night and for the most part things went well. However we had a user report and issue and it ended up being that they had configured call forwarding on the primary server and after switching to the secondary the changes were not there.

Right now I am backing up the following:

MySQL: Config server (excluding backup stuff)
AMPBIN (excluding moh and sounds)
ASTETCDIR (excluding cdr_mysql.conf)

Two seconds of googling would have got you


I do have /var/lib/asterisk/astdb.sqlite3.

I’m not sure what scripts you are referring to. I feel like I used to recall seeing something to backup this database but I don’t see it in the backup/restore anymore.

In order to maintain the settings, can I simply copy the file from one server to the other or is it more complicated than that?

I don’t know if the distro includes the old backup/restore astdb scripts you may have to get them from the mirror. /var/lib/asterisk/bin

As I said it contains the “state” of Asterisk, including things like “call forwarding” , go on, google Astdb and see :wink:

I am running 4.211.64-6 of the distro. I believe that most things I do are stored in the asterisk MySQL DB.

So this astdb.sqlite3 DB, what does it do that the MySQL doesn’t? If I want to replicate those settings (whatever they may be) to the secondary server can I just include the file in the backup set?

They didn’t move because I said the Asterisk DB that uses Berkley DB. That has nothing to do with MySQL.

As Dicko mentioned, newer versions of Asterisk do support SQL storage of ASTDB however this is in the meat of call processing, make sure that you do it right. The Berkley DB is all cached in memory (usually).

If you are using a newer version of asteriskitmovedthe database from berkeley to sqlite the state of asterisk is now stored in:-


Any idea why that setting I speak of didn’t come over if I am doing the MySQL backup/restore?

In the Asterisk Berkeley DB

I saw that link the other day but did not read through it. I just read through it but it doesn’t answer my question. What I would like to know is moving this to another system and if that works or some other functionality is needed. I don’t know if there is system specific data in the database that will mess up the other server.

It says it will try to migrate/create the database if it doesn’t exist it will create it which implies I suppose you could just move it but I don’t know what is in it and I don’t really want to try and crack it open at the moment.

If it doesn’t exist, it will be created empty, that is not what you want, as I keep on saying, it contains to state of asterisk, when asterisk reads /etc/asterisk/*.conf files it will also add them but not of course the sate of your DND and forwarding you had on your old machine. Read the link again for insight.

I read the link again and am still not clear. It has a lot of troubleshooting information but doesn’t say what data it contains. Both systems run at the same time so they will both have this database. I do a daily backup/restore from the primary to the backup and want them to be identical from a configuration standpoint.

If you are saying that the user portal settings are only contained in this astdb then I need that file to come over as well. If that is correct, am I able to just move the file or is it more complicated?

I am not trying to be difficult or dull but I don’t see that answer anywhere.

Just copy the sqlite3 file into your new box while asterisk is stopped then restart asterisk and reload FreePBX.

OK thanks, I will do some testing and see if I get the desired results.

I don’t think that will work.

Make sure you do a “show database” from Asterisk and do a stare and compare.

“database show” works even better.

OK so I went down this trail some more today and did a diff of the two databases and see the difference we were talking about so I need to bring this DB over when I do the restore.

Before I do that, I need a little clarification. I have the backup configured to pull the “Asterisk DB” from the module but it doesn’t say what that is. Is that /var/lib/asterisk/astdb.sqlite3 or something else?

I just opened the backup file and it has astdb in the root but I’m not sure what if anything the restore is doing with it.