The number of migrants across the world is at a record high – 244 million people left their homes in 2015, according to the United Nations. They were driven by war, dire economic straits and, for some, worsening environmental conditions brought on by climate change.

There’s a growing body of evidence linking migration and climate change, from Pacific island nations being subsumed by the rising ocean to the drought-wracked Horn of Africa. In a speech this spring, United Nations Secretary-General António Guterres warned that “as regions become unlivable, more and more people will be forced to move from degraded lands to cities and to other nations.”

A recent report from Oxfam found that more than 20 million people a year have been displaced by extreme weather events since 2008, mostly in developing countries.

But linking migration to climate change is tricky because the environment is just one of many pressure points often happening at the same time.

Take the case of northeastern Nigeria, where nearly 2 million people are displaced. Climate change is clearly a factor: Lake Chad, the region’s main water source, has been drying up as the Sahel Desert expands southward.

But at the same time, the Islamic insurgence of Boko Haram has run a brutal terrorism campaign. Rural poverty and food insecurity were already major problems. Economic opportunities are better in the south. So what combination of factors is causing people to leave home?

For any given instance of migration, how can we know the impact of climate change, if at all?

A new study may help with that question by looking at a very different wave of migration with 150 years of hindsight. Researchers at Germany’s University of Freiburg analyzed 19th-century migration from central Europe to North America, and discovered new evidence suggesting climate change played a major role in spurring mass movements of people.

Through the 1800s, about 5 million people immigrated to North America from what is now southwest Germany, including President Trump’s grandfather, Friedrich, who moved to the United States in 1885. The study, published Tuesday in the peer-reviewed journal Climate of the Past, found that up to 30 percent of those people moved because of climate disruptions.

That figure is much higher than researchers expected, said lead author Rüdiger Glaser. Research on historic migrations has tended to overlook climate change. “I was surprised, to be honest,” Glaser said. “The 19th century is a period with remarkable changes in the climate, economy and politics. This is like a case study of learning how system change works.”

The findings reveal a historical precedent for a pattern that is increasingly familiar: unusual weather, followed by crop failures, followed by economic instability, followed by a mass exodus.

The study’s window of time, from 1812 to 1887, was a transitional period in climate history following the so-called Little Ice Age, when global temperatures were much cooler than today.

As temperatures began to heat up in response to what we now recognize as manmade global warming, it was a time of tumultuous year-to-year variability. Years of drought were suddenly punctuated by crop-killing cold snaps. So while the “climate change” people experienced then was different from what we’re living through now, its impact on food systems was similar.

Researchers identified a handful of emigration peaks throughout the century, then matched those to historical records of weather, harvests and prices for local staple grains such as barley, oats and rye.

The upshot, Glaser said, is that researchers should make better use of historical records to look for clues about how climate migrants might behave in the future.