Generally, your data will not lost, when you install Windows 8, the setup wizard asks what you would like to do with your existing files. Upgrading from Windows 7 gives you the most options because you can choose to copy over user files, settings and applications. If you don't tell the wizard to carry over anything, it creates a folder named Windows.old, stores your personal files in it and deletes everything else before installing Windows 8.
Tips: After you install Windows 8, make your next upgrade easier by keeping important files that you create in a common location. For instance, if your old operating system had important documents scattered across different locations on your hard drive, Windows may not have copied them to the Windows.old folder during the upgrade. Keeping critical documents in your Documents folder ensures that they survive when you install a new operating system and choose the option that instructs windows to tell Windows to create a Windows.old folder.