Food I think would easier to switch to a different supplier or buy a totally different one (like the alternatives I've mentioned). With oil and gas though it'll take longer to build new pipelines.
This is one reason Russia invaded - the pipelines are already built and Ukraine can use those to export their own gas that has been discovered there - in areas conveniently occupied by Russia now. That would have provided an alternative to Europe.
Its hard to switch if many country is not executing to plant those product and they have other things exist on their country. But if more country will realize that they are lacking an important product and want to became self sustaining country then maybe they should look at this aspects and make their country great by investing on those resources which can help their country to boost up.
Those what happen to Russia is wake up call to all government on any parts of the world to find a solution towards ongoing crisis brought up by certain products hold on that country.
Well they can start planting now. I think the main possible issue with switching is if the current producers are producing enough for their current market. Like, the Americas produce corn for their consumption but we don't know if they'll have enough excess to sell if the people feeding on wheat switches to corn suddenly.