As far as I know (and saw in practice) the direct upgrade from Windows 7 to 8.1 isn't possible, you will have only an option to keep all user files, but not any program. To upgrade to 8.1 with keeping all software, need to use the intermediate upgrade to Windows 8.0, after that 8.0 to 8.1 is in-place upgrade without any loss. If you don't worry about installed programs, upgrade to 8.1 (which technically is a clear install with keeping %userprofile%) is the best choice. Otherwise you have two options: upgrade from 8.0 to 8.1 using ISO image / DVD or via Microsoft Store. I suggest to use ISO because Store upgrade requires preliminary installation of many 8.0 updates, which in fact are excessive and only take a lot of time.
So, the best option if you need to keep all is to upgrade to 8.0 directly using DVD or ISO and then to 8.1 the same way. Windows 8.1 image still can be downloaded from MS server, but 8.0 image is no longer available. You have to acquire DVD or look for ISO on the other websites, which isn't a simple task. However, some retail stores still can sell the outdated and unsupported Windows 8.0 DVD with the key, which is also good for 8.1. And it may be relatively cheap, esp. the upgrade version.
As for a key, it's possible to install 8.0 and 8.1 with a temporary non-suitable for retail activation key, like a KMS key, and then change it to a real retail key. Anyway the process will take less than 3 days, so non-activated system shouldn't be a problem
