Shops aren't required to take the old local currencies anymore, but they can still be swapped.
Here for instances the information if the German Bundesbank, where you can still swap with the official rate of 1.95583 DM/€.
https://www.bundesbank.de/de/aufgaben/bargeld/dm-banknoten-u...
(Currently there is a restriction of in person service due to corona, but if you trust mail it works, else you have to wait for that Corona restriction to be lifted)
The purpose of the new series is just to keep up with counterfeit money, to include newer security measures.
But yes, countries in the world have revoked currencies from time to time.