Upgrading Debian Wheezy to Debian Jessie

This document will help guide you through upgrading a Debian 7 (Wheezy) server to a Debian 8 (Jessie) server.

We highly recommend that you perform all of these steps on a test system before making changes to your production server -- that way, you can minimize downtime by knowing what all to expect.

These steps are a succinct version of the full Debian upgrade guide available here: http://www.debian.org/releases/stable/i386/release-notes/ch-upgrading.en...

You should plan for some downtime -- there are big differences between the two distributions, and things don't always go as smoothly as we'd hope. The Debian release notes suggest making sure you have console access during the upgrade process, as certain changes could potentially cause issues during the boot process.

Upgrade Guide

Backups

Make sure you have full backups of everything on your server that's important to you. At the very least, you'll want to generate full backups of all your Virtual Servers. You may also want to make a backup of everything in /etc. Additionally, the Debian release notes suggest backing up /var/lib/dpkg and /var/lib/apt/extended_states prior to an upgrade.

Update Packages

Make sure your system is fully up to date by running this command:

apt-get update && apt-get upgrade

Verify that it finishes completely and without errors.

dpkg audit

Run this command to see if there are any packages in an incomplete state:

dpkg --audit

If there are, you'll need to fix those packages before continuing with the upgrade.

Reset Dependency Flags

These packages are already installed, but the following command will tell apt not include them anytime "apt-get autoremove" is run:

apt-get install bind9 spamassassin spamc procmail libnet-ssleay-perl libpg-perl libdbd-pg-perl libdbd-mysql-perl quota iptables openssl python mailman subversion ruby irb rdoc ri mysql-server mysql-client mysql-common postgresql postgresql-client awstats webalizer proftpd webmin usermin webmin-virtual-server libcrypt-ssleay-perl webmin-virtual-server-theme webmin-virtualmin-dav webmin-virtualmin-svn webmin-virtualmin-awstats webmin-virtualmin-mailman webmin-virtualmin-htpasswd clamav-base clamav-daemon clamav clamav-freshclam clamav-docs clamav-testfiles libapache2-mod-fcgid scponly apache2 apache2-doc libapache2-svn libsasl2-2 libsasl2-modules sasl2-bin usermin-virtual-server-theme procmail-wrapper php-pear php5 php5-cgi webmin-security-updates

Edit sources.list

Edit /etc/apt/sources.list, and change any reference of wheezy to jessie.

Third party repositories

Also in /etc/apt/sources.list, if you happen to have any third party repositories enabled, such as DotDeb, you may want to comment those out until after the upgrade.

Update Package Metadata

Update the package metadata by running:

apt-get update

Note Regarding Prompts

The next few steps will have you installing various packages. Some of those will ask you questions. The defaults to those questions are typically fine. That said -- be sure to fully read all the questions so that you understand what changes are being made.

Begin distupgrade

You can now begin the upgrade process with this command:

apt-get dist-upgrade

That will take some time to run, but it will ask you questions along the way, so you'll need to babysit the process.

Reboot

When the upgrade completes, perform a reboot. When your system comes back online, there's just a few more things to change.

Apache Config

There were some significant changes made to Apache. You'll need to make the following updates to /etc/apache2/apache2.conf:

Comment out the following lines that appear in the apache2.conf:

LockFile ${APACHE_LOCK_DIR}/accept.lock

Comment out this line from /etc/apache2/mods-enabled/ssl.conf:

SSLMutex file:${APACHE_RUN_DIR}/ssl_mutex

Re-enable Apache modules that were automatically disabled during the upgrade:

a2enmod suexec
a2enmod actions
a2enmod rewrite
a2enmod proxy
a2enmod proxy_balancer
a2enmod proxy_connect
a2enmod proxy_http
a2enmod dav
a2enmod dav_fs
a2enmod dav_svn

Then restart Apache:

service apache2 restart

Log into Virtualmin

Log into Virtualmin, and you should see a notice at the top where it detects the change to Debian 8. Click the Update Detected Operating System button.

Next, go into System Settings, and run the Re-Check Config, and verify that it doesn't detect any problems.

Complete

You should now be finished. Now is the time to test everything and make sure it all works as expected!