Hard drives, while they do have a finite lifespan, can probably survive 100 years or more. Furthermore, the components likely to fail can be replaced.
Surprisingly CD-ROM (and DVD-ROM and ...) are going to last for centuries or millennia. Even writable CD-ROM will do. They also have the advantage that if necessary you can read them through a microscope. So failing components don't matter that much. With enough patience you could read them with a microscope, pen and paper.
All kinds of data medium loses their information over time. Even the novel you wrote in highschool 10 years ago (as an example) with pen & paper would lose ink overtime due to evaporation. There is a reason books are lost in time.
There is one and probably only one exception to this: flowing data. Only data that is constantly refreshed would stay on forever.