Restore Fails...sigh!


(Greg Snover) #1

Ok - I am in the process of moving my hosted FreePBX instances to a totally different platform hence the need to do a Backup and then Restore of the config in the new instance.

I thought that I would have the best chance of success if the machines (old and new) were exact duplicates of each other, so I did the following before I even started (on both machines):

yum update -y
fwconsole ma upgradeall

On the New machine I also removed all the extraneous Commercial Modules that I wasn’t using - I also rebooted the old machine and the new machine once I had done the updates so the would be as close to “same” as I could make it.

Ran a complete backup on the old machine and then went to the new machine to restore it. Tried to restore it through the GUI and it started looping over and over again - I think it was hanging on UCP but I couldn’t really tell - it just kept flashing the screen over and over with scrolling so what it was hanging on was never on the screen long enough to copy and paste what it was choking on - ok, let’s try it from the cli:

fwconsole backup --restore 20210613-131105-1623611465-15.0.17.34-211733073.tar.gz

It runs for a while and then it bombs out with this:

Importing KVStore from endpoint
TFTP ringtones and images Files Restored
Rebuilding config for extension/template
PHP Fatal error: Call to undefined function FreePBX\modules\endpoint_write_ext() in /var/www/html/admin/modules/endpoint/Endpoint.class.php on line 405
Whoops\Exception\ErrorException: Call to undefined function FreePBX\modules\endpoint_write_ext() in file /var/www/html/admin/modules/endpoint/Endpoint.class.php on line 405
Stack trace:

  1. Whoops\Exception\ErrorException->() /var/www/html/admin/modules/endpoint/Endpoint.class.php:405

I have searched the web, but no one else has posted this error - has anyone else here seen it?

The bigger question is (once again) how am I supposed to rely on Backup/Restore - this has almost always been my experience with it which is why I was trying to migrate my VM’s - It just never works when I need it!

Any help would be appreciated!


#2

Does your backup include any ‘endpoint manager’ data set ?
Does it work if you try and restore a backup without that data set ?


(TheJames) #3

You should also open a commercial module ticket as this is a bug in the restore handler


(Greg Snover) #4

Yes - all of my systems include EPM - I could try not restoring that, but that kind of defeats the purpose - I am trying to move the machines without breaking anything - my EPM configs are not terribly complex, but recreating them will inevitably result in mistakes being made - change is always perceived as failure by the customers.


(Greg Snover) #5

How is that new? I have never done a restore without it either crashing out or not restoring some component or another.

I honestly don’t think this module/feature will ever work the way it should.

I am working on a Manual migration now - tar-ing up all the relevant directories myself and just overwriting all the relevant folders - I will post how that goes here in a minute.


(Defcomllc) #6

I’ve done 2 backup and restores both fully updated version 15 to dissimilar hardware without a single issue over the past few months.


(Greg Snover) #7

Well, tarring up all the relevant directories and then just overwriting the new machine worked like a dream!

Just in case anyone wants to go down this road, here are the directories I copied over from the old machine onto the new machine - I stopped Asterisk/Apache/Mysql before I overwrote the files, but everything seems to be working perfectly! Finally - A Backup I can actually use! Include all sub-directories.

/etc
/tftpboot
/var/lib/asterisk
/var/lib/mysql
/var/spool/asterisk
/var/www/html

I have been testing and I can’t find anything that is not working with this restore, so mission accomplished! If anybody knows of a folder I should be including (and why) please let me know - I have lots of machines to move over the next few weeks, so if I find anything missing, I will post it here! But at least this works!


#8

I would question that you should do all of /etc a lot of things including networking (ips and macs) and uuids of disks and even the machine itself of will not be the same but are set in that space.


(Lorne Gaetz) #9

This ticket shows a similar issue:
https://issues.freepbx.org/browse/FREEPBX-22449

In the above, the restore was done on a non-registered system, was that the case for you as well @GSnover


(Greg Snover) #10

Yes, figured that out the hard way - I am working on a bash script right now - /etc/sysconfig is a real no-no for this purpose - I am working on it today and will post my script up when it is solid (backing up what it should and NOT backing up what it shouldn’t!).

Can you think of any other directories though? I am doing a stare-and-compare on a couple of machines trying to find all the places that FreePBX touches.


(Greg Snover) #11

Yes, it was an un-activated machine. My Googling did not find that bug report.

So it’s a requirement that the machine be activated before you can run the restore? That seems kind of counter-intuitive because I wouldn’t want to activate the machine until I was sure the restore worked properly!

You run out of Zend resets really quickly on any individual instance.

Postscript on this post:

Tried another restore with the machine being activated:

Looks like almost all of the settings and files are restored, but EPM is empty - missing my Yealink definition and all of the assigned devices and settings. Oh well - I don’t know if it’s better or worse than doing it manually.


(system) closed #12

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.