((Beaten to much of this, while editing it down. Darn.))
Some estimates put the (digital equivalent of the analogue information) of each gold disc to be up to 2Gb. Which will probably survive particle ablation (though nothing like a bored Klingon captain 'clearing space debris') for quite a long time in its current packaging, while drifting in open space.
It is estimated that (read/write-cycles aside, the biggest and most immediate failure danger to data) a memory stick left on the shelf can last 'decades' (70 to 100 years, by one optimistic study, I recall, but not sure how accurate). By contrast, I recall CDRs, when I researched this around the turn of the millenium (before memory sticks were a thing) were
possibly safe for 20 years, but recommended for no more than 5 before cycling them into a read-and-make-new-copy process, and for the rest of the time keep them in as dark a cupboard as you can (if not, ideally, in your fireproof safe). CDRWs were even more fragile, as they were
designed with 'reversible burning' in mind. Pressed CDs are proof against that, but can still be damaged. Magnetic discs (hard ones decaddied, and floppies of course) were variable, but the wirry back in the day was more EMP 'attack' (or gereral remote 'wearing away' of mangetic domain polarisations by the subtle deguassing effect of the mains wiring running through the building they're stored in.
You can probably guard against moisture and/or oxidisation (affecting the memory chip), light itself minimises as inverse square as you move away from the Sun, plus you'd probably put a CDR(W) ,
in something, above its own consumer-level casing, magnetic flux probably tails off unless you're unlucky (once beyond the VAB) and there's no risk of over-using any of those data-containers. But you've got ionising radiation that isn't as prevalent down here
Citation Needed to contend with, messing with nanoscopic features of all these media (for HDDs, at least the controller electronics, if not the platter contents) in ways that could scramble of degrade the precise data stored thereupon.
We could probably use something like Norton Utilities on some of these errors, a bit of intelligent guesswork on others.
Given that we know what on Earth (or beyond) the media formattings are like. It might be a bit trickier when
even a decade or two of zee-rust and obselescence has occured on what was once considered the latest and best tech. And as for aliens understanding what to do with whatever just fell (gently enough) into their laps after centuries (at best, to assume there's still useful data left in the media to extract and decode), I'm not convinced.
In the case of the Pioneer/Voyager artefacts (and Arecebo broadcast), some thought was given to how 'readable information' could be portrayed recognisibly and potentially understandably, and the artefacts should do far better
maybe enough in weathering the conditions of space to give them that potential foot in the door. You'd want to make sure you included at the very least a 'cheat sheet' quick reference guide as part of the package of whatever you sent, not knowing quite what the future custodians are going to be aware of when they get down to unwrapping your gift from the past.