The above assumes CiviCRM 4.7.x and standard locations for the files
Updated to show extension settings and to move mail passwords out of the Database