Exactly like smart people get rid of obsolete items selling them to those who are less “informed”, who are one step behind technology, so do states: sell weapons that no longer meets current defense strategies.
The Soviet Union spent much on arming, then realizing that they were made in vain. This kind of things had happened to the United States as well.
Non-aligned states have jasmine revolution and buy a lot of outdated weapons from ex-combatants of the Cold War. This is how clever guys get rid of ballast. In Russia, on the Caspian Sea shore, a huge warship rusts. In the U.S., there is a huge war aircraft cemetery, besides the civil aircraft one.