Debian 12 and new deployment script

1st wanted say thank you for debian install script. I was able to get new server up and testing now.

What is the proper migration path from existing instance to new deployment. Used webui to backup the existing install and on new instance restore using tarball it created. When I try to apply/fwconsole reload gives an error. Let me know if you need anything else.

fwconsole reload -vv
Reload Started

In PJSip.class.php line 1440:

Endpoint already exists.

Exception trace:
at /var/www/html/admin/modules/core/
FreePBX\modules\Core\Drivers\PJSip->generateEndpoint() at /var/www/html/admin/modules/core/
FreePBX\modules\Core\Drivers\PJSip->generateEndpoints() at /var/www/html/admin/modules/core/
FreePBX\modules\Core\Drivers\PJSip->genConfig() at /var/www/html/admin/modules/core/Core.class.php:300
FreePBX\modules\Core->genConfig() at /var/www/html/admin/libraries/BMO/FileHooks.class.php:99
FreePBX\FileHooks->processNewHooks() at /var/www/html/admin/libraries/BMO/FileHooks.class.php:28
FreePBX\FileHooks->processFileHooks() at /var/www/html/admin/libraries/Console/Reload.class.php:340
FreePBX\Console\Command\Reload->reload() at /var/www/html/admin/libraries/Console/Reload.class.php:95
FreePBX\Console\Command\Reload->execute() at /var/www/html/admin/libraries/Composer/vendor/symfony/console/Command/Command.php:312
Symfony\Component\Console\Command\Command->run() at /var/www/html/admin/libraries/Composer/vendor/symfony/console/Application.php:1022
Symfony\Component\Console\Application->doRunCommand() at /var/www/html/admin/libraries/Composer/vendor/symfony/console/Application.php:314
Symfony\Component\Console\Application->doRun() at /var/www/html/admin/libraries/Composer/vendor/symfony/console/Application.php:168
Symfony\Component\Console\Application->run() at /var/lib/asterisk/bin/fwconsole:163

reload [–json] [–dry-run] [–skip-registry-checks] [–dont-reload-asterisk]

PBX Version:
PBX Distro:
Asterisk Version:

cat /etc/os-release
NAME=“Sangoma Linux”
VERSION=“7 (Core)”
ID_LIKE=“centos rhel fedora”
PRETTY_NAME=“Sangoma Linux 7 (Core)”


New version:
PBX Version:
PBX Distro:
Asterisk Version:

cat /etc/os-release
PRETTY_NAME=“Debian GNU/Linux 12 (bookworm)”
NAME=“Debian GNU/Linux”
VERSION=“12 (bookworm)”

You could try export/import using the bulk handler module. Did you have any existing extensions on the Debian server before trying to restore the backup?


Thanks for the response.

No extensions on the new system, it is a fresh install.
On existing system backup everything and tried restoring and received my previous posted error. Reverted the snapshot to fresh install tried backup and restored only the “core” modules and received same error.

Reverted the snapshot and validate the new system is working, setup couple of extensions and able to make phone calls.

I’ll revert again and try bulk handler, trying to avoid re-provisioning 100+ phones across 4 sites.

Where do we define endpoints? Guessing it is in mysql database, what table?

We define these vars in a private function that is throwing the exception. Slightly modified the function in hope of identifying the problem record after a restore. Record contains null and zero space data most like just needs to be deleted to apply. Any pointers on what table?

            if (isset($retarr["pjsip.endpoint.conf"][$endpointname])) {
                    throw new \Exception("Endpoint XX $endpointname XX $authname XX $aorname already exists.");

Endpoint XX XX -auth XX already exists.

This boiled down to a user being clever. Deleting corresponding record allowed me to apply configuration.

I modified the throw to see where data was wrong.
delete from devices where id = ‘sting in question’;

i modified below function to output $config, and grepped it out sql dump to delete
if (isset($retarr[“pjsip.endpoint.conf”][$endpointname])) {

                    throw new \Exception("Endpoint $endpointname already exists.");