How to backup freepbx when GUI is down?

hey folks
i want to ask
if i have freepbx is down and damaged for some reason .

how ca i extract info like

extensions usr/pwd
trunks
inbound & outbound routing

?

is there a method like extract them over DB ?

or i must see them from conf files?

what is best method ?

again , no way to get GUI up !

cheers

You can enter in the linux shell and backup:

/etc/asterisk/
/etc/freepbx.conf/
/var/lib/asterisk/
/var/spool/asterisk/

Dump the MySQL(Âż?) database. It have almost all the configurations.

But… I prefer to ask, why you can´t bring up the freePBX GUI? Maybe it is easier.

Note: I’m little rusty so I may miss some paths, better check /etc/asterisk/asterisk.conf and the wiki of FreePBX.

1 Like

its very old piaf sever and it crashed and i don’t see many people react on old piaf .

so i want to reinstall it .

so again .

say i want to dump the mysql , is it the best fro recovery in this case ?

cheers

Your Extension and Trunk details are in the file:

/etc/asterisk/sip_additional.conf

All your dialplan (including inbound routing) is in extensions_additional.conf, but you may find it very difficult to find what you want there.

If you goal is to move to a supported version of FreePBX, I bet this tool would work for you even without a working GUI:
http://wiki.freepbx.org/display/PPS/Elastix+and+PBXinaFlash+to+FreePBX+Distro+Conversion+Tool

2 Likes

yes i know
if i just copied files … will that affect or be reflected on my GUI settings ??
i don’t think so !

No. For that I recommend the migration tool.

cool i see the page says about freepbx 13 as donor server

is this tool only for freepbx new fresh disro ? or it can be on any freepbx version

kind regards

The donor machine can be FreePBX 2.9 and up. The new machine must be an activated, current FreePBX Distro 10.13 deployment.

yes I’m talking about the new machine

must be freepbx 13 ?

Yes.

i did on piaf

but i have an error

The FreePBX Conversion Wizard needs to be run on two machines, the NEW
machine, which must be an ACTIVATED FreePBX Distro machine, and then it must
be run on the DONOR machine.
The DONOR machine is the machine that is currently processing calls, and is
the machine that will be migrated to the NEW machine. No changes will be made
to the DONOR machine, and this script will not stop or restart any services
that may cause an outage.
If this is the NEW machine, just push ‘Enter’ to prepare this machine

Enter ID (blank if this is NEW): 2defs320f-95b5-4082-9cd7-5c43fv517d5b
Testing FreePBX functionality … Failed. Received ‘/etc/freepbx.conf doesn’t exist.
This must be run on a FreePBX machine’ instead of 'OK’
Cleaning up…Done!

i have file as /etc/amportal.conf

not /etc/freepbx.conf

so what to do in this case ?

The file must exist, try the following:

cp /etc/asterisk/freepbx.conf /etc/freepbx.conf

root@phone:~ $ locate freepbx.conf
/etc/asterisk/extensions_override_freepbx.conf
/home/fop2/server/extensions_override_freepbx.conf
/root/backupfop2-bin/fop2/extensions_override_freepbx.conf
/usr/local/fop2/extensions_override_freepbx.conf
/usr/src/fop2/server/extensions_override_freepbx.conf
/usr/src/freepbx/amp_conf/bin/libfreepbx.confgen.php
/var/lib/asterisk/bin/libfreepbx.confgen.php

actually i don’t see freepbx.conf

and this may be reason on why GUI is down and give me blank page

but i don’t know exactly what happen to the serve

buti have file

/etc/amportal.conf

not sure if that can help

cheers

Well if you don’t have that file, that would certainly break the GUI. If you can’t find a copy from a backup, you might try recreating it:

# cat /etc/freepbx.conf
<?php
$amp_conf['AMPDBUSER'] = 'mysql_username';
$amp_conf['AMPDBPASS'] = 'mysql_password';
$amp_conf['AMPDBHOST'] = 'localhost';
$amp_conf['AMPDBNAME'] = 'asterisk';
$amp_conf['AMPDBENGINE'] = 'mysql';
$amp_conf['datasource'] = ''; //for sqlite3

require_once('/var/www/html/admin/bootstrap.php');

i did and i still have old error
[Wed Jan 04 07:42:54 2017] [error] [client x.x.104.95] PHP Fatal error: Call to undefined function module_run_notification_checks() in /var/www/html/admin/config.php on line 145

?

root@phone:~ $ curl -k -s https://convert.freepbx.org | bash
Checking that ‘curl’ exists … OK!
Validating sha256 integrity … OK!
Trying to download converter to /tmp/tmp.FSvMI17711 … Complete!
Validating download … OK!
Starting FreePBX Converter version release/20151217r1
Testing connectivity to Conversion server…Success!

FreePBX Conversion Wizard

The FreePBX Conversion Wizard needs to be run on two machines, the NEW
machine, which must be an ACTIVATED FreePBX Distro machine, and then it must
be run on the DONOR machine.
The DONOR machine is the machine that is currently processing calls, and is
the machine that will be migrated to the NEW machine. No changes will be made
to the DONOR machine, and this script will not stop or restart any services
that may cause an outage.
If this is the NEW machine, just push ‘Enter’ to prepare this machine

Enter ID (blank if this is NEW): bb9ba8cd-79c1-48b5-95df5-15e060435829
Testing FreePBX functionality … PHP Warning: require_once(/var/www/html/admin/bootstrap.php): failed to open stream: No such file or directory in /etc/freepbx.conf on line 9
PHP Fatal error: require_once(): Failed opening required ‘/var/www/html/admin/bootstrap.php’ (include_path=’.:/usr/share/pear:/usr/share/php’) in /etc/freepbx.conf on line 9
Failed. Received ‘’ instead of 'OK’
Cleaning up…Done!

Sigh. What version of FreePBX is this? Lack of bootstrap indicates it’s older than the requisite version 2.9 (or severe problems with the system). Either way, it looks like it’s time to give up and start over with a fresh Distro install.

yes its very very old piaf sever

        PBX in a Flash Version  Daemon Status                

  • Asterisk * ONLINE * Zaptel * ONLINE * MySQL * ONLINE *
  • SSH * ONLINE * Apache * ONLINE * Iptables * ONLINE *
  • Fail2ban * OFFLINE * IP Connect* ONLINE * Ip6tables * ONLINE *
  • BlueTooth * ONLINE * Hidd * ONLINE * NTPD * ONLINE *
  • Sendmail * ONLINE * Samba * ONLINE * Webmin * ONLINE *
  • Ethernet0 * ONLINE * Ethernet1 * N/A * Wlan0 * N/A *

  • Running Asterisk Version : Asterisk 1.4.21.2
  • Asterisk Source Version : 1.4.21.2
  • Zaptel Source Version : 1.4.12.1
  • Libpri Source Version : 1.4.9
  • Addons Source Version : 1.4.7

phone.signatureforum.com on 192.168.1.253 - eth0
CentOS release 5.4 (Final) :32 Bit Kernel: 2.6.18-92.1.22.el5


For help on PBX commands than you can run type help-pbx *


Holy crap - I thought I was running some old stuff. You’ve got me beat.

It sounds like the “PEBCAK” backup is going to be your best option.

Basically, screen shot your trunks, your inbound and outbound routes, and your SIP Settings. That will get your communication with your ITSP working. If you can’t get screenshots, of the old settings, the information is stored in the conf files in the /etc/asterisk directory. Note that copying these files to your new server might seem like a good idea, but they will just get overwritten as soon as you turn the new FreePBX on.

Next, if you can use the extension dump utility (I don’t know if you can anymore), dump the extensions to a CSV file and update it for the Bulk Handler. If you can’t, use the information on the Help screen for bulk handler and build a CSV file to import your extensions.

Yes, this is going to be painful (not really, it’s just going to take an hour or two) but it’s the price you pay for not updating the system.

1 Like

the problem is :slight_smile:
my GUI is down !!
and seems very hard to be fixed :slight_smile:

and all my work now from cli