Introduction
As you may know, Linux Debian 9 Stretch was recently introduced, which received many wonderful updates: support for new hardware, improvements in the apt package manager, security improvements, and others.
Our clients 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 the 3CX server.
However, if you already have a telephony server running and you just want to upgrade the OS, use the instructions below.
')
Debian update
These instructions are for systems using Debian 8 stock or ISO 3CX for Debian 8 image. If you installed additional packages or used the system for tasks other than 3CX, consider this when upgrading.
So let's get started!
Let us start by clearing the apt cache to make room for installing updates.
apt-get clean
Now install the latest updates on Debian 8. This will allow you to start the transition to Debian 9 with the most recent build of Debian 8 and avoid potential problems. This is the standard recommendation when updating.
apt -y --force-yes update apt -y --force-yes upgrade
Go 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 -is/jessie/stretch/g /etc/apt/sources.list
Now we will update and re-index the repository.
apt -y --force-yes update
Remove 3CX packages to start updating a clean Linux system. Removing 3CX software packages does not remove the configuration and 3CX data!
apt -y --force-yes remove 3cxpbx
Run the OS update on Stretch.
apt -y --force-yes upgrade
During the update, several questions will appear. If you have no experience with Linux, it’s best to watch
this video to see which options to choose.
Next, we will launch the process of automatic restoration of connections between dependencies.
apt -y --force-yes dist-upgrade
Debian is currently updated, dependencies are in order, and 3CX components have been removed (except for data). It remains to understand the versions of the Postgress database.

Debian Stretch comes in a newer version of Postgress DB (9.6) than the one that 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
and update it
pg_upgradecluster 9.4 main
Install the remaining 3CX dependencies (libcurl).
apt -y --force-yes install libcurl3=7.38.0-4+deb8u5
Now that everything is ready, you can install 3CX.
apt -y --force-yes install 3cxpbx
Checking the system and removing unnecessary components
Verify that 3CX is installed and successfully launched. 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 worthwhile to remove unnecessary components, in particular the old cluster 9.4.
pg_dropcluster
Remove the other components of the previous system. They are already irrelevant, and you simply free up disk space.
apt-get -y
Clear the packet cache again to leave more space for 3CX
apt-get clean
and restart the system
shutdown -r now
Check that the Debian system is updated (must show version 9.2)
cat /etc/debian_version
Check kernel version
uname -a
Should give something like this
Linux mydebian 4.9.0-3-amd64
Ready script
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. You should also use it if you maintain many 3CX systems.
Save it to disk, and then execute the command that will make it executable,
Chmod 777 ./update.sh
and follow
./update.sh
Conclusion
I hope this guide will be useful, especially for a system administrator with little experience in Linux. Once again, I recommend watching the
video , which describes the work of this script. In the video you can turn on the translation of titles into Russian.