How to upgrade from Debian Linux 8 Jessie to Debian 9 Stretch using command line over ssh based session

It is possible to upgrade to Debian 9 from Debian 8 using ssh. This tutorial shows how to upgrade from Debian 8 Jessie Linux to Debian 9 Stretch using command line. Make a backup (I am using Rsnapshot) – it cannot be stressed enough how important it is to make a backup of your system before you do this. Most of the actions listed in this tutorial are written with the assumption that they will be executed by the root user