The expected economic lifetime of a building in Germany is approximately 100 years. Which means that on average, the house will be torn down and rebuilt after at most 100 years, because additional upkeep would not make economic sense.
This means that if you do not change policy except mandating modern standards for new buildings (which is already done) and do literally jack-shit, the normal economic activity will have the problem sorted out in that timespan.
For reference: Of 22 million buildings in Germany, "only" 12.5 million are built before 1977.
The German government aims at having pretty much all buildings energetically renovated in 2050.
The biggest problem is that 1. there are many house-owners who literally do not give a shit even if they can save lots of money by an investment. Not everyone is economically minded and there is no political will (or legal basis) to force these people for their own good. And 2. for bigger apartment buildings etc. it is hard to do an invasive renovation while the units are occupied, limiting the scope of renovations to something that can be done in-place or one unit at a time or without affecting tenants.