Upgrading from Debian 8 to Debian 9

3CX is a PBX server in Cloud Server 3CX.Contact us to find out our latest offers!

Upgrading Debian 8 Jessie to Debian 9 Stretch for 3CXAs you already might have heard, Debian 9 “Stretch” is released. And boy, the improvements it comes with over its  predecessor “Jessie”… impressive!! New 4.9 Linux kernel supporting newer hardware, improvements to apt and overall security beefed up.

This leaves 3CX and Debian 8 users with some questions marks. Should Jessie users hold on a little while longer?  Can 3CX and Jessie users upgrade to Stretch now?

Well if you want to give it a try, you can download the 3CX ISO whereby you will end up with a fully fledged Debian 9 OS + latest version of 3CX installed.

If you like what you see in Debian 9 and you want to upgrade your existing Jessie installs to Stretch, then yes, let’s get cracking.

Have a look at the video and also study the commands below. We will be explaining each part.

Note: This upgrade procedure applies to users that installed stock Debian 8 or used the 3CX Debian 8 ISO without making any modifications to the OS. If users installed other packages or are using their Debian OS for other purposes apart from 3CX, then you will need to fix those issues on your own.

So lets start off….

Lets clean up apt cache from previous use to have more space available for the update:

apt-get clean

Now, lets bring your Debian 8 to the latest update. Like this we commence the upgrade from a stable point:

apt -y --force-yes update
apt -y --force-yes upgrade

Enter the new 3CX Stretch Repository (because what you had before was the 3CX Jessie repo):

echo "deb http://downloads.3cx.com/downloads/debian stretch main" | tee /etc/apt/sources.list.d/3cxpbx.list

Using “sed” command, lets search for all instances of the name “jessie” in /etc/apt/sources.list and replace it with “stretch”:

sed -i s/jessie/stretch/g /etc/apt/sources.list

Now issue a force update to reindex repos:

apt -y --force-yes update

Remove 3CX so we responsibly upgrade on a clean base. We will only remove the 3CX Package leaving all the data intact:

apt -y --force-yes remove 3cxpbx

Fire the commands to update to Stretch:

apt -y --force-yes upgrade
apt -y --force-yes dist-upgrade

Stretch comes with a newer version of postgress (9.6). 3CX used to use 9.4 in jessie. So before we install 3CX, lets ensure that all 3CX dependencies are OK:

apt -y --force-yes install postgresql-9.6 postgresql-client-9.6
pg_dropcluster --stop 9.6 main
pg_upgradecluster 9.4 main

Lets proceed to install other dependencies of 3CX:

apt -y --force-yes install libcurl3=7.38.0-4+deb8u5

Now that all dependencies are in order, we will install 3CX:

apt -y --force-yes install 3cxpbx

We will check that the installation is OK, and that you have all your data. You can launch the 3CX Management console and see that all your data are intact. After this we can do housekeeping and drop the old cluster (the 9.4 one):

pg_dropcluster --stop 9.4 main

Keep your cleaning cloths handy because we have more cleaning to do – let’s remove more leftovers and clutter from previous packages:

apt-get -y --force-yes autoremove

Cleanup apt cache to have more space available for 3CX:

apt-get clean

Reboot debian

shutdown -r now

Check that Debian is updated by running this command (you should get 9.1) :

cat /etc/debian_version

Also you can check the kernel version:

uname -a

You should get 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

If you want to download the script instead of running all these commands you can download update.sh. Save it in a location, and then run this command on it to make it a working executable  “Chmod 777 ./update.sh” and after launch ./update.sh

This script is perfect for unattended upgrades. 

Hope you found this helpful, make sure to let me know what you think.

Discuss this article with our community:


3CX is a PBX software available in Cloud Server 3CX.Contact us to find out our latest offers!

Comments are closed.