Buried at each pole of the moon would be a good bet. It would be protected from all by the most extreme of impacts, and the lack of weather makes that the only real threat. Luna regolith will deal with a lot of the hard radiation.
We would want to put something on the surface, as a marker. I would include something like a radar retro-reflector. Any civilisation advanced enough to reach the moon will, at some point sweep it with radar, purely out of curiosity. Strong returns from both poles would definitely get their attention.
The archive itself could be etched sapphire. 2nd hardest substance to make, and easier to make in sheets than diamond.













Unfortunately, magnets will lose their field strength over time. After that, they are just a big lump of iron. Solar panels also have a limited lifespan. They could do 100s of years, maybe, but no longer. They will also be prone to getting buried by dust kicked up by micro meteor impacts.
I might have put too much thought into this… 😁