In FreePBX 15, Dynamic Routes are not included in Backup/Restore. I assume that this is due to the way Backup/Restore was re-written in FreePBX 15+ which requires additional functions added to the actual module code.
I am no PHP developer, but if someone can tell me which module might have similar Backup/Restore code that would work for DynRoutes, then I can try to draft something.
Created a backup to only backup the DynRoutes module
Ran the backup
Deleted the DynRoute object
Applied config.
Restored the backup via command line.
Confirmed that DynRoute object was restored.
The below is a bit unrelated to this topic…
I noticed that DynRoutes depends on Core, Recordings & Soundlang.
Doesn’t the including dependencies idea sort of defeat the feature of allowing us to restore a specific module only to a certain state?
I guess there are two things that need to happen.
Show in the GUI what modules will be included in this backup. I know it says in the log. But the logs are sometimes very long and you can easily miss the line where it says so.
Either during backup or restore allow the admin to exclude the dependencies with a big banner “AT YOUR OWN RISK”
Anyway, back to getting this version released. Is there anything else that needs testing?
Thinking now that I could’ve probably skipped step 1 and go straight to step 2, but I didn’t try…
fwconsole ma delete dynroute (or whatever the module name is) and reload fwconsole reload. Note: this will actually delete all the Dynamic Routes data you currently have. So perhaps try going straight to step 2 which shouldn’t delete anything.
Download that ZIP file, go to module admin, upload this zip from your hard disk, once uploaded go back to the module list and click install.
Someone added something without testing but hey this was generally just a tool for me when I had to write and test backup in every single module. I know it is in internal documentation but nobody reads that so it is unlikely anyone except me even knows about this.
Not that you know what is or isn’t written by me but most things i have done heavy work on typically have console commands that can be useful for testing and troubleshooting
This is also fixed in the latest backup edge version. Thank you @kgupta
Running backup (note, you can only save to /var/spool/asterisk/backup)
[root@freepbx ~]# fwconsole backup --backupsingle ivr --singlesaveto /var/spool/asterisk/backup
Transaction ID is: d2c3c894-4c68-49eb-827f-cbc1d899967d
Processing ivr
Working with ivr module
Adding module manifest for ivr
***In single restores mode dependencies are NOT processed***
There was nothing to cleanup
Finished created backup file: /var/spool/asterisk/backup/ivr-20220615-065909-1655290749-15.0.29-180725149.tar.gz
Backup completed successfully
Restoring the backup:
[root@freepbx ~]# fwconsole backup --restoresingle /var/spool/asterisk/backup/ivr-20220615-065909-1655290749-15.0.29-180725149.tar.gz
Transaction ID is: c22156c1-1da1-40f7-b49a-7d3a0bccd2f2
Extracting backup...
***In single restores mode dependencies are NOT processed***
Resetting ivr module data
Dropping table ivr_entries...Done
Dropping table ivr_details...Done
Updating tables ivr_entries, ivr_details...Done
Generating CSS...Done
Restoring from ivr [FreePBX\modules\Ivr\Restore]
Done
Finished
Restore completed successfully
Whoever has permissions, please update the wiki. Thank you