Upgraded to FreePBX 15 all user, phone books and configuration is gone

Is there any way to restore this?


  • try editing the file /var/www/html/fop2/config.php and input the credentials to login to mysql and to database 'asterisk'...
    make sure DBNAME is 'asterisk' (you may see 'fop2' but change to 'asterisk') and input correct credentials to login to asterisk database.
    Then you can try if phonebook is correct.

  • It looks like the DB data is no longer in amportal.conf. Some of the config scripts for fop2 seem to know how to look in /etc/freepbx.conf but the config.php file doesn't have logic to do that. I'll take a stab at that and try to submit a quick snippet here.

  • Here is a quick hack that seems to fix things:
    In config.php:

       if (is_readable("/etc/freepbx.conf")) {
           $amp_conf = parse_amportal_conf("/etc/freepbx.conf");
           $DBHOST = $amp_conf['AMPDBHOST'];
           $DBNAME = $amp_conf['AMPDBNAME'];
           $DBUSER = $amp_conf['AMPDBUSER'];
           $DBPASS = $amp_conf['AMPDBPASS'];
       } else if (is_readable("/etc/freepbx/freepbx.conf")) {


           if (preg_match("/\\\$amp_conf\[\"([^\"]+)\"]\s*=\s*\"?([\w\/\:\.\*\?\%!=\+\#@&\\$-]*)\"?\s*([;].*)?/",$line,$matches)) {
               $conf[ $matches[1] ] = trim($matches[2]);
           } else if (preg_match("/^\s*([\w]+)\s*=\s*\"?([\w\/\:\.\*\?\%!=\+\#@&\\$-]*)\"?\s*([;].*)?/",$line,$matches)) {
               $conf[ $matches[1] ] = trim($matches[2]);
  • I forgot to add that you should also run mysql_secure_installation (don't set root password). Otherwise the logic in config.php will get a connection for the blank user, but wont have any access to dbs.

Sign In or Register to comment.