Things to be aware of for a successful FreePBX 15 to 16 upgrade

The versionupgrade module does a couple of stupid things.
Here is my ticket on the subject for anyone that wants gory details

Note: I do everything with an upgrade via the command line. This has always worked out better than using the GUI.

First, it messes up a file permission in /var/www/html, so you need to run fwconsole chown after you install it.
Second, if you run it with sudo from a user other than root, it fails to properly do everything, even though it says the upgrade succeeds.
Third, it does not check for ioncube to already be installed. Fixed in version upgrade 15.0.19
Fourth, it puts in the sng7php74 repo file more than one time.

So, to make your experience better, here is how I would run the upgrade from FreePBX 15 to 16

  1. Login with your non-root user. Because you never allow root to log in over ssh right?
  2. Update the system
sudo yum upgrade -y
  1. Remove ioncube if you already have it installed (most people will not), not required if your version upgrade versions is 15.0.19 or later.
sudo yum remove ioncube-loader-56
  1. Upgrade the current modules.
sudo fwconsole ma upgradeall
  1. Fix permissions
sudo fwconsole chown
  1. Reload
sudo fwconsole reload
  1. Reboot
sudo reboot
  1. Log back in and then switch to root.
sudo su -
  1. Download the versionupgrade module
fwconsole ma downloadinstall versionupgrade
  1. Fix permissions again
fwconsole chown
  1. Reload
fwconsole reload
  1. Run the version upgrade check and use fwconsole ma delete MODULENAME to remove any depreciated modules. If you do this, also make sure to fwconsole reload.
fwconsole versionupgrade --check
  1. It should be clean, so upgrade. If you have issues, before you revert your snapshot, download the freepbx16_upgrade.log file from /root in order to look at what went wrong.
fwconsole versionupgrade --upgrade | tee -a freepbx16_upgrade.log
  1. Fix any issues you may have. I had a broken restapi, likely left over from when this system was FreePBX 13.
fwconsole ma delete restapi
fwconsole reload
  1. Once everything looks good, reboot and see if it all comes up again normally.
reboot
8 Likes

Thank you for a proper post! Well done! What’s the difference between 15 and 16? Ours is running but yet not to be in use. We’re not there yet… It’s all!

That sure was a painful upgrade! Ha!
Thank you for sorting things out!

“campon” module was one that was broken for me.

I also had to touch /etc/asterisk/extconfig_custom.conf, an #included file that was missing, for Asterisk to start. This may be handled by fwconsole chown but I’m not sure; I created the conf file right after I saw that Asterisk wouldn’t start and saw the reason in the log.

2 Likes

Version Upgrade 15.0.19 resolve campon, as well as a restapi.

Installing version upgrade drops a gpg file in the cache folder owned by root. Which causes the subsequent check to fail because of files owned by root.

I’ve added that to my bug report. Out of all the things found with this search, that is the only one resolved by fwconsole chown, and the check works after that.

[jbusch@pbx ~]$ sudo find /var/www/html -group root
/var/www/html/admin/assets/dynroute
/var/www/html/admin/assets/versionupgrade
/var/www/html/admin/assets/api
/var/www/html/admin/assets/filestore
/var/www/html/admin/assets/sangomaconnect
/var/www/html/admin/libraries/Composer/vendor/bin/doctrine-dbal
/var/www/html/admin/libraries/Composer/vendor/respect/validation/tests/fixtures/symbolic-link
/var/www/html/admin/modules/_cache/versionupgrade-15.0.19.tgz.gpg
/var/www/html/admin/cxpanel
[jbusch@pbx ~]$ sudo find /var/www/html -user root
/var/www/html/admin/assets/dynroute
/var/www/html/admin/assets/versionupgrade
/var/www/html/admin/assets/api
/var/www/html/admin/assets/filestore
/var/www/html/admin/assets/sangomaconnect
/var/www/html/admin/libraries/Composer/vendor/bin/doctrine-dbal
/var/www/html/admin/libraries/Composer/vendor/respect/validation/tests/fixtures/symbolic-link
/var/www/html/admin/modules/_cache/versionupgrade-15.0.19.tgz.gpg
/var/www/html/admin/cxpanel
[jbusch@pbx ~]$ sudo fwconsole chown
Taking too long? Customize the chown command, See http://wiki.freepbx.org/display/FOP/FreePBX+Chown+Conf
Setting Permissions...
Setting base permissions...Done in 5 seconds
Setting specific permissions...
 67775 [============================]
Finished setting permissions
[jbusch@pbx ~]$ sudo find /var/www/html -group root
/var/www/html/admin/assets/dynroute
/var/www/html/admin/assets/versionupgrade
/var/www/html/admin/assets/api
/var/www/html/admin/assets/filestore
/var/www/html/admin/assets/sangomaconnect
/var/www/html/admin/libraries/Composer/vendor/bin/doctrine-dbal
/var/www/html/admin/libraries/Composer/vendor/respect/validation/tests/fixtures/symbolic-link
/var/www/html/admin/cxpanel
[jbusch@pbx ~]$ sudo find /var/www/html -user root
/var/www/html/admin/assets/dynroute
/var/www/html/admin/assets/versionupgrade
/var/www/html/admin/assets/api
/var/www/html/admin/assets/filestore
/var/www/html/admin/assets/sangomaconnect
/var/www/html/admin/libraries/Composer/vendor/bin/doctrine-dbal
/var/www/html/admin/libraries/Composer/vendor/respect/validation/tests/fixtures/symbolic-link
/var/www/html/admin/cxpanel
1 Like

versionupgrade 15.0.19 enables way too much logging to console to be immediately helpful. The next upgrade I worked, failed. But the verbose spew scrolled everything beyond my console default scrollback cache.

I’ve updated the above upgrade command to use tee to create a log file.
For the curious, here if the output spew from 15.0.19 for a successful upgrade.
https://pastebin.freepbx.org/view/ff82d2a3

Thank you, Jared! Our first attempt to upgrade last night using the GUI failed immediately at the PHP7.4. We restored from backup and then followed your steps in CLI. All is well “except” for AD sync. I will be opening another thread for that, most likely. The error is “Internal Server Error: Option admin account suffix does not exist.” Users are there but their permissions aren’t. UCP and all logins but our local admin are rejected. UCP console log shows the above internal server error. The GUI displays the following:

There appears to be at least two reports here: [FREEPBX-23120] Userman Option admin_account_suffix does not exist - Sangoma Issue Tracker


Edit
This particular issue was addressed and corrected.


-Sean

Jared - thank you for this , it works. our 1ST attempt has info here: 15 to 16 upgrade issue

one small suggestion , at the end of:

fwconsole versionupgrade --upgrade | tee -a freepbx16_upgrade.log

when this line displays .
‘System upgrade completed successfully.’

perhaps a note that at that point press control + c to complete .

Thank you for these instructions. They are superb .

2 Likes

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

Just to know:
The process is that all V15 modules are deleted in the first step.
Next the new version 16 is going to be downloaded.
After that the intention is to install the V16 modules.
Therefore, my cloud-server has a monthly transaction volume of 20GB. The package to be downloaded has a volume of 24 GB. Finally what happend: Total crash of the PBX. Because all modules were deleted, and V16 can not be installed since new version can not be fully downloaded. Result is a reduced OS with even missing basic commands. Not even ls is available any more.
There is no possibility to restore anything, without a cloud-server snap-backup.
So keep care for your installation.

In 2022 a monthly download limit of 20GB is ridiculously low, I suggest you find another provider.

3 Likes

So even there an unlimited ingress, OP needs to reconsider, but 2TB is an awful lot of phonecalls

Any way. This cloud-server was Hetzner Germany at 5 € per month. I changed to an other provider with unlimiited transaction volume.
Just to know: Is there any possibility - something like CDR or on the web-gui start page to see the data-volume of e.g. the last month or so? By the way: Is there a possibility for outside inbound / outbound calls statistics? Specifically how many at the same time? This would be currently important for me to decide on the telco-provider’s offer how may outside lines to buy. Each line costs its monthly fee.

I just wanted to mention that this guide was helpful and worked well for me. That said, if you are exceptionally lazy and just want to copy and paste, here is what worked for me - take a VM snapshot or backup, and just dump these into terminal via SSH one-by-one, and it should spit out a fully upgraded system:

yum upgrade -y && fwconsole ma upgradeall && fwconsole chown && fwconsole reload && reboot

fwconsole ma downloadinstall versionupgrade && fwconsole chown && fwconsole reload

fwconsole ma delete dahdiconfig

fwconsole ma delete digiumaddoninstaller

fwconsole ma delete digium_phones

fwconsole ma delete pbdirectory

fwconsole ma delete vega

fwconsole ma delete speeddial

fwconsole ma delete motif

fwconsole ma delete campon

fwconsole ma delete restapi

fwconsole ma delete dundicheck

fwconsole ma delete queuemetrics

fwconsole ma delete freepbx_ha

fwconsole versionupgrade --upgrade | tee -a freepbx16_upgrade.log

yum upgrade -y && fwconsole ma upgradeall && fwconsole chown && fwconsole reload && reboot

2 Likes

I did everything as described above.
Now complete asterisk directory is missing, only cent-os is basically living.
Last message from pbx:
[root@Apu3C4Baisweil ~]# fwconsole versionupgrade --upgrade | tee -a freepbx16_upgrade.log
Sorry incron.d could not pick upgrade process
Any process, how to bring it back to life???
Im still connected via console, did no rwconsole reload (doesn’t work anymore) and no reboot.

yum is still running:
root@Apu3C4Baisweil tmp]# yum history
Geladene Plugins: fastestmirror, versionlock
Repository sng-sng7php74 is listed more than once in the configuration
Existierende Blockierung /var/run/yum.pid: eine andere Kopie läuft mit PID 2349.
Another app is currently holding the yum lock; waiting for it to exit…

How to stop yum from running?
Can I wget the latest 16 freepbx-version?
Can I yum install the latest version?
How?
Finally I want to restore my latest V15-backup to get the pbx running again.

one hour later: Since yum was still running, finally the upgrade to 16 went through with some not upgraded modules and security warnings, which needed to be upgraded afterwards (via web-iterface)

one hour later: Since yum was still running, finally the upgrade to 16 went through with some not upgraded modules and security warnings, which needed to be upgraded afterwards (via web-iterface)

Thank you for the update, it helped me not to reboot the server too early.

as a thank you I opened my account to just be able to post as a Thank you

I figured out that you can see the upgrade logs so you know what is going on

tail -f /var/log/pbx/freepbx16-upgrade.log

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