First off: I informed the users of the free social media instances about the upcoming upgrade and the downtime to be expected.
Make sure all the software are in their latest version
# apt update && apt upgrade
Made backups of /etc, /var/lib/dpkg, /var/lib/apt/extended_states/home/username, /var/www and the output of dpkg --get-selections "*" and stored them off-site. Additionally I took a snapshot of the system disk just in case the upgrade doesn’t go well then it is possible to revert to the pre-upgrade situation.
Next checked for non-Jessie software with
$ apt-forktracer | sort
It found some items from jessie-backports but nothing that is in use.
Checked for half-installed packages with
# dpkg --audit
Nothing of interest was found. Just one dummy package.
Check for packages on hold
# dpkg --get-selections | grep 'hold$'
None were found.
Edit the /etc/apt/sources.list
Now update the /etc/apt/sources.list changing each occurrence of ‘jessie’ with ‘stretch’. I did it with sed (Stream EDitor) but it is also possible to manually edit the file with your favourite editor.
# sed -i 's/jessie/stretch/g' /etc/apt/sources.list
Start session recording for later reference
Next start session recording with (replace step with a number. When needing to reboot then restart the session recording with an incremented number)
# script -t 2>~/upgrade-stretchstep.time -a ~/upgrade-stretchstep.script
If you have used the -t switch for script you can use the scriptreplay program to replay the whole session: