Export extension related config to CSV


i need to migrate about 500 extensions and inbound routes from freepbx 2.5 and asterisk 1.4 to freepbx 2.9 and asterisk 1.6. i have read that this is not possible with a backup from within freepbx for some strange reason. so instead of trying to overcome issues i had with that before i am going to approach this entirely different. the only problem i have now is that i can not find a way to export all information from the ‘extension’ display into a CSV. if i had that i could create the extensions on the new system with bulk extensions. has anybody solved this problem before ?

an NO, it is not an option to bring the old version up to 2.9 and backup then.

alternatively i can imagine someone with good sql skills could query the database and pick the right information from there. since i am not that good with sql maybe someone else has tried this angle and can help out ? here the information i would need to get from each extension:

Extension, Display Name, Outbound CID, Ring Time, Secret, Accountcode, Voicemail Password

The databases havd changed significantly, that is why backup and restore does not work between versions.

Certainly bulk import is an option.

As far as doing the DB stuff manually, without going into how the module system works in FreePBX let’s just say that even the developers that have tried failed.

I understand you saying you can update the system to 2.9, I would have to ask why?

Worst case is you do a backup and restore to another 2.5 system then uograde that system.

With a project of this side I would engage FreePBX support to be a part of the migration.

i don’t intend to configure the new system via direct db manipulation. i have seen that this seems to be not possible as way to many things are involved. i will use CSV and bulk extensions. what i need to accomplish in the 1st place is that i need to get the CSV created from the information on the extension page in freepbx. i am currently trying to find a way to export the information to a CSV. the way the tables are made in 2.5 i can not simply dump a table and have all the info. my sql knowledge is to limited to create a query across different table and multiples rows etc.

if i get support involved and pay for that then i would want to get a procedure that i can follow and possibly share with others. i wont let someone that i dont personally know get access to my servers.


Install the bulk extensions and bulk DID module. This will do the CSV export for you.

If this is an old trixbox that does not have bulk extensions (Fonality did a lousy job of forking our software) simply download the bulk tools v 2.5 from mirror.freepbx.org/modules

hmmm… can’t seem to find it. i had a look here:


but no bulk extensions there.

instead i have figured out a sql query that gives me most of what i need actually.

(SELECT sip.data FROM sip WHERE sip.id = users.extension AND sip.keyword = ‘accountcode’) AS accountcode,
(SELECT sip.data FROM sip WHERE sip.id = users.extension AND sip.keyword = ‘secret’) AS secret

just the voicemail password seems to be somewhere else but not in mysql. i have to digg a little further, did not yet spend much time finding it.


Again, I know it seems painfully obvious but you can’t just write to the one table.

For example if they are SIP extensions the information has to be in the SIP table.

Here is the link to bulkextensions:


BTW, I always look in release not branch

i do know that, i have no intention to write anything but to get the combined info OUT of the old PBX. then i have a plain text file i can modify as i need to have a file conforming to the bulk extensions CSV for creating the extensions on the new PBX. so the intention of above query is NOT (!!) to put that output in the new PBX directly. its just to give me the variable parts from our specific installation.

but i go as well and have a look at the 2.5 version of bulk extensions. thx for the link.


the export from bulk extensions does it, thanks for the info !!