Restore to FreePBX 17 is broken again...Here is a Workaround

A couple of weeks ago, I went out to one of my Schools and tried to replace their On-Premise FreePBX 16 with a shiny new FreePBX 17 virtual machine - I got all the way to restoring the Backup, but when I did, it didn’t throw any errors but I had no extensions (Zero!). Weird, but I still had the original machine, so I generated another backup and then tried to restore it again and…same thing - no extensions.

I ran out of time to work on it anymore, so I set it aside to work on other things.

Today, I tried to replace one of my FreePBX 16 machines on Vultr.

Same drill - Make sure the machine is fully up-to-date, run a Backup, load up a Debian 12 and then run the FreePBX 17 install script, and then finally, restore the backup.

Again, no errors, but when I was done, no extensions and only my Emergency Outbound Route (?).

I did some Google-Foo, and I saw a couple of posts about a similar problem, but no solution.

So I restored the old machine (it’s the same Virtual Machine) and used Bulk Handler to export every setting it could, copied all my Outbound Routes (they were simple) and then reloaded Debian 12 and ran the FreePBX 17 install script again.

I then used Bulk Handler to import all the exported settings - my Extensions were there.

Then I restored the Backup and it DELETED MY EXTENSIONS!

So I re-imported the Extensions using Bulk Handler and then finally recreated my Outbound Routes and I once again had a working machine now on FreePBX 17.

LOTS of extra work, but at least it works - I hate the Backup App with a passion that burns like fire…

Hopefully somebody sees this before they get stuck the way I did.

I remember hitting something similar to this with one of my District upgrades as well… luckily one of my smaller districts… I pretty much moved all my Districts over the summer of 25… Everyone was a different experience (ay yai yai)… I started having much more success handling the upgrades via CLI. Ironically my largest District went the smoothest lol…

I’ve never seen that with the extensions, but I have consistently seen that issue with the outbound routes. It will only copy over the emergency route.

I’m two-for-two so far with this - I will be upgrading more boxes this weekend and will post a scoreboard.

Why has Backup always been so terrible???

@GSnover In my case… Going back just under a year I do believe I recall it was a versioning bug with the module itself, thats a big IF memory serves me correctly… do you use the Web UI module or CLI?

I was running the restore using the GUI - Does it make a difference if you restore it from the CLI?

I have seen more success doing it this way + you get to see all the verbose language as it runs so one can see “snags” and such. There’s also some really unique flag options that may be applicable to your scenarios… It truly did become my preferred method.

I just found this page: FreePBX Open Source - Upgrading to FreePBX 17 - FreePBX Open Source - Sangoma Documentation

It has the commands for restoring via the CLI - i will do that on my next machine and see if it works any better…It would be kind of wacky if GUI restore fails, but CLI restore works - shouldn’t it be doing the same thing?

Please update with results when you try. I have a prospect stuck on some version of v13 and wants to get to v17. I’m obviously not planning to go to v17 directly. Looking to stagger upgrade to 16 but I’d like to know battle field experience of upgrading from 16 to 17. And how much effort required so I know how to wring the finance department at this tight fisted prospect

Not really, running something through the web server and the cli are not the same thing. You have other factors with the web server like timeouts and perhaps the web server locked up processing the request…it’s also why PHP has an web php.ini and a cli php.ini.

Well, I just tried to do a restore via the cli - Here are the error messages I saw on the CLI…

#1:
Completed restoring mysql dumps of : Routing
Invalid sequence order: 3 on line 135 of file /var/www/html/admin/modules/core/Components/Outboundrouting.php

#2:
Refreshing the endpoint tables.
The command “/usr/sbin/fwconsole ma install endpoint -f >> echo $!” failed.

Exit Code: 2(Misuse of shell builtins)

Working directory: /usr/src

Output:

Error Output:

sh: 1: cannot create echo: Permission denied
on line 272 of file /var/www/html/admin/libraries/Composer/vendor/symfony/process/Process.php

#3:
Finished
There were errors during the restore process
Invalid sequence order: 3 on line 135 of file /var/www/html/admin/modules/core/Components/Outboundrouting.php
The command “/usr/sbin/fwconsole ma install endpoint -f >> echo $!” failed.

Exit Code: 2(Misuse of shell builtins)

Working directory: /usr/src

Output:

Error Output:

sh: 1: cannot create echo: Permission denied
on line 272 of file /var/www/html/admin/libraries/Composer/vendor/symfony/process/Process.php
There were warnings during the restore process
Can’t find the module data for ttsengines
Can’t find the module data for callback
Can’t find the module data for miscdests
Can’t find the module data for phonebook
Can’t find the module data for setcid

Couple of those look like iSymphony errors…These machines have been in service a LONG time.

Anyways, I had the Bulk Handler exports, so I just imported them, and we are good - and I had to recreate my Outbound Routes…sigh.

To quote Buddy from The Incredibles, “Lame, Lame, Lame!”

What a bummer on the outbound routes, I think I only had one of my upgrades do that. (Different experience every time)

Sorry it wasn’t the cureall for your situation. :grimacing:

Further Bummer - Trying to make changes to a Polycom Template on the machine I just restored, I get this error message back with a full trace:

PDOException (42S22)

SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘setPreferCidOverLookup’ in ‘SET’

4

PDOException

/var/www/html/admin/modules/endpoint/functions.inc/functions_common.php1677

3

PDOStatement execute

/var/www/html/admin/modules/endpoint/functions.inc/functions_common.php1677

2

endpoint_save_template

/var/www/html/admin/modules/endpoint/views/page.endpoint.php424

1

unknown

/var/www/html/admin/modules/endpoint/page.endpoint.php10

0

include

/var/www/html/admin/config.php668

Have to go and research what that means…

Ok - I just had to reinstall the Endpoint Module to fix the error…