Upgrade Debian 7 to 8

More than 1 year has passed since last update.

To upgrade Debian OS from 7 to 8 by itself.

update the packages in 7

apt-get update

apt-get upgrade

modify the sources

Replace all wheezy in /etc/apt/sources.list to jessie.

upgrade packages to 8

apt-get update

apt-get upgrade
apt-get dist-upgrade

The last one might be run twice if needed.

remove unused packages

apt-get autoremove


delete the linux image

apt purge linux-image-3.2.0-4-amd64 -y

For Apache/PHP module

You might have to purge all php packages and reinstall them, and find extension directory by php -i | grep extension_dir and edit it manually to php.ini.