1. Create a backup of database and code. place maintenance.flag file inside 1.7 code folder to put website offline.
2. Download magento 1.9 from the http://www.magentocommerce.com/download
3. Remove all folders and files from your 1.7 code except maintenance.flag (but you should have backup somewhere) and place all folders and files from the 1.9.
4. Now from your 1.7 merge your following custom folders into the 1.9
- Community app/code/community
- Local app/code/local
- Your theme or package
- Custom folders from Skin (both for adminhtml and frontend).
- Copy your custom xml files from app/etc/modules/ to current app/etc/modules/
- Any custom admin theme folder from adminhtml/default/yourtheme.
- Copy your custom folders from adminhtml/default/default/ (1.7) to adminhtml/default/default/ (1.9).
- Custom js files if any from app/js/
6.Do not forget the encryption key of the old version. When upgrading the site to new installation, be sure to use the same Encryption Key
7. Login into admin panel and regenerate Index and Cache Management.
8. Remove maintenance.flag file and check the site in the browser. it is done.
Note: Never use Magento Connect Manager. There are many issues with it. Also when upgrading with Connect you will not know which modifications it did .