3CX upgrade from Debian 8 Jessie to Debian 9 Stretch
- Recovery mode
As you may know, the Linux Debian 9 Stretch OS was recently introduced, which received many wonderful updates: new hardware support, improvements in the apt package manager, security improvements, and others.
Our customers have a question: should we continue to work with Debian 8 or can we somehow upgrade the 3CX system to the Debian 9 platform?
Of course you can! First of all, we recommend trying the 3CX ISO image , which already uses Debian 9 along with the latest version of 3CX server.
However, if you already have a telephony server and you just want to update the OS, use the instructions below.
These instructions apply to systems using the stock Debian 8 or ISO 3CX for Debian 8. image. If you installed additional packages or used the system for tasks other than 3CX, keep this in mind when upgrading.
So let's get started!
Let's start by clearing the apt cache to make room for installing updates.
Now install the latest updates on Debian 8. This will allow you to start the transition to Debian 9 with the latest build of Debian 8 and avoid possible problems. This is a standard upgrade recommendation.
apt -y --force-yes update apt -y --force-yes upgrade
Let's move on to the 3CX Stretch repository (before that, the 3CX Jessie repository was used).
echo "deb http://downloads.3cx.com/downloads/debian stretch main" | tee /etc/apt/sources.list.d/3cxpbx.list
The sed command finds all entries with the name "jessie" in /etc/apt/sources.list and replaces it with "stretch":
sed -i s/jessie/stretch/g /etc/apt/sources.list
Now update and reindex the repository.
apt -y --force-yes update
We will remove 3CX packages to begin updating a clean Linux system. Removing 3CX Software Packages Does Not Delete 3CX Configuration and Data!
apt -y --force-yes remove 3cxpbx
Run the OS update on Stretch.
apt -y --force-yes upgrade
During the upgrade process, several questions will appear. If you are not experienced with Linux, it’s best to watch this video to see which options to choose.
Next, we will start the process of automatic restoration of relations between dependencies.
apt -y --force-yes dist-upgrade
Debian is currently up to date, dependencies in order and 3CX components removed (except data). It remains to deal with the versions of the Postgress database.
Debian Stretch ships with a newer version of Postgress (9.6) than the 3CX used in Debian Jessie (9.4). First, make sure that the latest version of Postgress is installed on the system.
apt -y --force-yes install postgresql-9.6 postgresql-client-9.6
Stop the old cluster
pg_dropcluster --stop 9.6 main
and update it
pg_upgradecluster 9.4 main
Install the rest of the 3CX (libcurl) dependencies.
apt -y --force-yes install libcurl3=7.38.0-4+deb8u5
And now, when everything is ready, you can install 3CX.
apt -y --force-yes install 3cxpbx
Checking the system and removing unnecessary components
Check that 3CX is installed and running successfully. Connect to the management interface and make sure that all settings are saved, 3CX services are working, etc.
If everything is in order, it is worth removing the extra components, in particular the old cluster 9.4.
pg_dropcluster --stop 9.4 main
Remove other components of the previous system. They are no longer relevant, and you just free up disk space.
apt-get -y --force-yes autoremove
Clear the packet cache again to leave more space for 3CX
and restart the system
shutdown -r now
Check that the Debian system is updated (should show version 9.2)
Checking the kernel version
Should give something like this
Linux mydebian 4.9.0-3-amd64 #1 SMP Debian 4.9.30-2+deb9u2 (2017-06-26) x86_64 GNU/Linux
As you can see, nothing complicated. But in order to simplify your life, we offer a ready-made update.sh script that will do all this automatically. It is also worth using if you service many 3CX systems.
Save it to disk, and then run a command that will make it executable,
Chmod 777 ./update.sh
I hope this guide will be useful, especially for a system administrator with little Linux experience. Once again, I recommend watching a video that describes the operation of this script. In the video, you can enable the translation of captions into Russian.