TERBOL, Lebanon — Ali Shehadeh, a seed hunter, opened the folders with the greatest of care. Inside each was a carefully dried and pressed seed pod: a sweet clover from Egypt, a wild wheat found only in northern Syria, an ancient variety of bread wheat. He had thousands of these folders stacked neatly in a windowless office, a precious herbarium, containing seeds foraged from across the hot, arid and increasingly inhospitable region known as the Fertile Crescent, the birthplace of farming.

Mr. Shehadeh is a plant conservationist from Syria. He hunts for the genes contained in the seeds we plant today and what he calls their “wild relatives” from long ago. His goal is to safeguard those seeds that may be hardy enough to feed us in the future, when many more parts of the world could become as hot, arid and inhospitable as it is here. But searching for seeds that can endure the perils of a hotter planet has not been easy. It has thrown Mr. Shehadeh and his organization, the International Center for Agricultural Research in the Dry Areas, or Icarda, squarely at a messy intersection of food, weather and war.

Icarda, though it received no state funding, was once known as a darling of the Syrian government. Based in Aleppo, its research had helped to make Syria enviably self-sufficient in wheat production. But a drive to produce thirsty crops also drained Syria’s underground water over the years, and it was followed by a crippling drought that helped to fuel the protests that erupted into armed revolt against the government in 2011.Icarda, in turn, became a casualty of the war. By 2014, the fighting drew closer to its headquarters in Aleppo and its sprawling field station in nearby Tal Hadya. Icarda’s trucks were stolen. Generators vanished. Most of the fat-tailed Awassi sheep, bred to produce more milk and require less water, were looted and eaten. Mr. Shehadeh and the other scientists eventually sent out what they could — including a few of the sheep — and fled, joining half the country’s population in exile.

And Icarda’s most vital project — a seed bank containing 155,000 varieties of the region’s main crops, a sort of agricultural archive of the Fertile Crescent — faced extinction.

Specimens in Terbol. Icarda drew on a backup copy of its collection, stored in Norway, to start the new operation. Credit Diego Ibarra Sanchez for The New York Times

But the researchers at Icarda had a backup copy. Beginning in 2008, long before the war, Icarda had begun to send seed samples — “accessions” as they are called — to the Svalbard Global Seed Vault, the so-called doomsday vault, burrowed into the side of a mountain on a Norwegian island above the Arctic Circle. It was standard procedure, in case anything happened.

War happened. In 2015, as Aleppo disintegrated, Icarda’s scientists borrowed some of the seeds they had stored in Svalbard and began building anew. This time, they spread out, setting up one seed bank in Morocco and another just across Syria’s border with Lebanon in this vast valley of cypress and grapes known as the Bekaa.

“We are doing our best to recreate everything we had in Aleppo,” Mr. Shehadeh said.

The Aleppo headquarters still contains the largest collection of seeds from across the region — 141,000 varieties of wheat, barley, lentils, fava and the like — though neither Mr. Shehadeh nor his colleagues know what shape it’s in. They haven’t been able to return.

Seed banks have always served as important repositories of biodiversity. But they’re even more crucial, said Tim Benton, a food security expert at the University of Leeds, at a time when the world needs crops that can adapt to the rapid onset of climate change.

“We have to grow considerably different things in considerably different ways,” Mr. Benton said. “Certainly for our prime crops, like wheat, the wild relatives are thought to be really important because of the genes that can be crossed back into the wheat lines we have in order to build resilience and adaptation to climate change.”

Especially important, Mr. Benton said, because they could easily vanish without protection.