It’s a sunny October day on the outskirts of the west German town of Bottrop. A quiet, two-lane road leads me through farm pasture to a cluster of anonymous, low-lying buildings set among the trees. The highway hums in the distance. Looming above everything else is a green A-frame structure with four great pulley wheels to carry men and equipment into a mine shaft. It’s the only visible sign that, almost three quarters of a mile below, Germany’s last hard coal mine lies beneath this spot.

Bottrop sits in the Ruhr Valley, a dense stretch of towns and suburbs home to 5.5 million people. Some 500,000 miners once worked in the region’s nearly 200 mines, producing as much as 124 million tons of coal every year.

Next year, that era will come to an end when this mine closes. The Ruhr Valley is in the midst of a remarkable transformation. Coal and steel plants have fallen quiet, one by one, over the course of the last half-century. Wind turbines have sprung up among old shaft towers and coking plants as Germany strives to hit its renewable energy goals.

But the path from dirty coal to clean energy isn’t an easy one. Bottrop’s Prosper-Haniel coal mine is a symbol of the challenges and opportunities facing Germany — and coal-producing states everywhere.

Grist thanks its sponsors. Become one.

Around the world, as governments shift away from the coal that fueled two ages of industrial revolution, more and more mines are falling silent. If there’s an afterlife for retired coal mines, one that could put them to work for the next revolution in energy, it will have to come soon.

The elevator that carries Germany’s last coal miners on their daily commute down the mine shaft travels at about 40 feet a second, nearly 30 miles an hour. “Like a motorcycle in a city,” says Christof Beicke, the public affairs officer for the Ruhr mining consortium, as the door rattles shut. It’s not a comforting analogy.

The brakes release and, for a moment, we bob gently on the end of the mile-and-a-half long cable, like a boat in dock. Then we drop. After an initial flutter in my stomach, the long minutes of the ride are marked only by a strong breeze through the elevator grilles and the loud rush of the shaft going by.

Grist thanks its sponsors. Become one.

When the elevator finally stops, on the seventh and deepest level of the mine, we file into a high-ceilinged room that looks like a subway platform. One of the men who built this tunnel, Hamazan Atli, leads our small group of visitors through the hall. Standing in the fluorescent light and crisp, engineered breeze, I have the uncanny sense of walking into an environment that humans have designed down to the last detail, like a space station or a submarine.

A row of hydraulic presses displayed at the Mining Museum in Bochum, Germany. Amelia Urry

A monorail train takes us the rest of the way to the coal seam. After about half an hour, we clamber out of the cars and clip our headlamps into the brackets on our hard hats. It is noticeably warmer here. There is a sulfurous smell that grows stronger as we walk down the slight incline toward the deepest point of our day, more than 4,000 feet below the surface, and duck under the first of the hydraulic presses that keep the ceiling from collapsing on us.

Because this seam is only about five feet high, we have to hunch as we move through the tunnel of presses, stepping through deep pools of water that swallow our boots. The coal-cutting machine is stalled today, otherwise it would be chewing its way along the 310-yard-long seam, mouthparts clamped to the coal like a snail to aquarium glass. The coal would be sluiced away on a conveyor belt to the surface, and the hydraulic presses would inch forward, maintaining space for the miners to work.

Instead, the mine is eerily quiet. Two miners, their faces black, squeeze past us. As we sit, sweating and cramped under the hydraulic presses, the bare ceiling above the coal seam gives up an occasional gasp of rock, showering down dust and debris.

Later, in a brightly lit room back on the surface, Beicke from the mining consortium asks me what I thought of the mine. I tell him that it seems like an extreme environment for humans. “Yes,” he nods, “it is like an old world.”

An old mine car sits as an exhibit in the former Zollverein Mine Complex. Amelia Urry

A few days earlier, Beicke and I had trekked to the top of a hill outside the long-shuttered Ewald Mine in Herten, a half-hour drive from Bottrop. We climbed a set of stairs to a platform with a view over the whole region, the fenced-off or leased-out buildings of the old mine sitting below us.

The Ruhr Valley encompasses 53 cities of Germany’s once-formidable industrial heartland, including Essen, Bochum, and Oberhausen. The whole region was once low-lying riverland, but these days large hills rear above the landscape. These are the heaps of rock removed from the mines, tons of slag excavated with the coal and piled up. It’s a stark visual reminder of what’s been emptied out from underneath.

As the mines have closed down, most of these heaps have been covered with grass, and many have been crowned with a statue or other landmark. On one hill outside Essen, there’s a 50-foot steel slab by the sculptor Richard Serra; on another, atop other heaps, wind turbines stand like giant mechanical daisies.

Germany has been hailed as a leader in the global shift to clean energy, putting aside its industrial past for a renewable future faster than most of the industrialized world. The country has spent more than $200 billion on renewable energy subsidies since 2000 (compare that to the United States, which spends an estimated $20 billion to subsidize fossil fuel production every year).

In 2011, Chancellor Angela Merkel’s government announced the beginning of a policy of “energiewende” to wean Germany off fossil fuels and nuclear power. Last year, wind, solar, and other renewables supplied nearly 30 percent of the country’s electricity. The goal now is to hit 40 percent in the next 10 years, while slashing carbon emissions 40 percent below 1990 levels by 2020.

Amelia Urry

That transition has happened alongside attempts to restore the Ruhr Valley’s landscape. For every hill raised above ground level, there is an accompanying depression where the land subsided as coal seams were emptied out. The land here sank as the coal seams closest to the surface were emptied out. Overall, the region has sunk about 80 feet.

Streams that enter the Ruhr Valley are no longer able to flow out the other side, Beicke explains, and now water pools in places it never used to. The mining company is responsible for pumping that water away, as well as pumping groundwater across the region, to keep the water table below the level of the existing mines. Any contaminated water in the old mines must be removed and treated to keep it from polluting the groundwater.

These are just a few of the mining company’s “ewigkeitsaufgaben” — literally, eternity tasks.

“As long as 5 or 6 million people want to live in this area, we will have to do that,” Beicke tells me, of the expensive water management. “Maybe 2,000 years in the future that will change, but until that happens, well.” He shrugs.

The government gives the mining consortium 220 million euros a year in subsidies to deal with all the consequences of coal mining. Unlike in the United States, where aging coal companies often sell off their assets or declare bankruptcy to dodge clean up bills, here the mining company will be pumping and treating water long after it has stopped being a mining company at all.

Despite a national commitment to a broad energy transition, many now think that Germany will fall short of its renewable energy targets, thanks to a number of confounding economic and social factors, including the continued use of a coal alternative called lignite, also known as “brown coal.” Germans have the highest electricity costs in Europe, and the rise of the country’s extreme right-wing party in the last election has been pinned, in part, on those high bills.

If Germany does continue to progress toward its climate goals, much of the new energy is sure to come from wind power. Germany has more wind turbines than any other country in Europe, many of them installed in the last six or seven years. But wind doesn’t blow consistently, so this shift has been a challenge for the electrical grid. Even slight disruptions in the power supply can have wide-ranging consequences.

As more wind turbines are turned on, and more coal plants are retired, this problem will only get bigger, and the challenge of storing all that intermittent energy will be even more important. Here’s where the country’s retired coal mines might prove useful again — as giant batteries for clean energy.

To turn a coal mine into a battery, all you need is gravity.

OK, you also need a lot of money (more about that later), but the basic principle is gravitational. When you lift a heavy object, it stores the power used to lift it as potential energy until it’s released and falls to the ground.

Let’s say the heavy object you’re lifting is water. When you want to store energy, you just have to pump the water uphill, into a reservoir. When you want to use that energy, you let the water flow back down through a series of turbines that turn the gravitational rush into electricity.

A shaft tower above the Prosper-Haniel coal mine. Amelia Urry

This is the basic plan André Niemann and Ulrich Schreiber conceived when they were dreaming up new ways to use old mines. It seemed intuitive to the two professors at the University of Essen-Duisburg: The bigger the distance between your upper and lower reservoirs, the more energy you can store, and what’s deeper than a coal mine?

Schreiber, a geologist, realized it was theoretically possible to fit a pumped storage reservoir into a mine, but it had never been done before. Niemann, a hydraulic engineer, thought the proposal was worth pursuing. He drummed up some research money, then spent a few years conducting feasibility studies, looking for a likely site in the Ruhr Valley and running the numbers on costs and benefits.

After studying the region’s web of fault lines and stratigraphic layers, Niemann’s team settled on the closing Prosper-Haniel mine. Their underground reservoir would be built like a massive highway tunnel, a reinforced concrete ring nine miles around and nearly 100 feet high, with a few feet difference in height from one side of the ring to the other to allow the water to flow, Niemann explains.

At max storage, the turbines could run for four hours, providing 800 megawatt-hours of reserve energy, enough to power 200,000 homes.

The appeal of pumped storage is obvious for Germany. Wind and sun are fickle energy sources — “intermittent” by industry lingo — and energy storage can help smooth out the dramatic spikes. When the wind gusts, you can stash that extra power in a battery. When a cloud moves over the sun, you can pull power back out. It’s simple and, as the grid handles more and more renewable energy, increasingly needed.

The only problem: It’s expensive.

As wind turbine and solar technologies have become cheaper, energy storage costs have stayed high. Pumped hydro, especially, requires a big investment up front. Niemann estimates it would cost between 10,000 and 25,000 euros per meter of tunnel just to build the reservoir, and around 500 million euros for the whole thing. Right now, neither the government nor the energy companies in the Ruhr Valley are willing to make that kind of investment.

“It’s not a business, it’s a bet, to be honest,” Niemann says with a shrug.

In spite of the increasing unlikelihood of the proposal becoming reality, delegations from the United States, China, Poland, France, South Africa, and Slovakia, among others, have visited Niemann and Schreiber in Essen to learn about mine pumped-storage. Virginia’s Dominion Energy has been studying the idea with the support of a Republican state senator, and a group from Virginia Tech paid a visit the week after I did.

Here’s where any attempt to draw comparisons across the Atlantic gets complicated. In the United States, the federal government has been relatively hands-off in helping coal-dependent regions move on from the industries that fueled their way of life. In Germany, by contrast, there’s a broad agreement about the need to shift to renewable sources of energy. And yet, even with all that social, political, and economic foresight, important and necessary innovations remain stalled for lack of investment.

The Ruhr Valley is not Appalachia. And yet the two regions share key similarities that offer some important lessons about the a path to a cleaner, more sustainable future.

The view over the Ruhr Valley today. Amelia Urry

Dying industries take more than jobs with them. Towns built around a single industry, like coal mining, develop a shared identity. For many workers and their families, it’s not as simple as picking up and finding a new line of work when the mine closes. Mining is seen as a calling, an inheritance, and people want their way of life back.

That’s how residents of the Ruhr responded when coal jobs started to decline.

“For a long time, people thought the old times would come back, the old days would return,” says Kai van de Loo, an energy and economics expert for a German coal association in Essen. “But they can never come back.”

In the United States, of course, calls to bring back the old days often works wonders as a political sales pitch. Donald Trump campaigned for president on promises to stop the “war on coal” and revive the dying industry, and mining towns across the Rust Belt supported him.

In Pennsylvania’s Mon River Valley, home to a once-thriving underground mining complex bigger than Manhattan, mining continues to exert an oversized influence. Some 8,000 people work in coal in the state, a portion of the 50,000 coal jobs left in the United States. That’s a far cry from the 180,000 people who worked in the industry 30 years ago.

And the legacy of coal mining on the landscape is hard to miss. Bare slag heaps rise above the trees, dwarfing the towns beside them. Maryann Kubacki, supervisor of East Bethlehem in Washington County, says that during rainy spells the township has to shovel the gritty, black runoff from their storm sewers.

But without the federal government leading the way with financial support as it has in Germany, getting these former coal towns on a new track is a daunting task. Veronica Coptis, director of the Center for Coalfield Justice in Pennsylvania, says that organizing people to put pressure on mining companies is a delicate matter. People don’t want to hear that coal is bad, or that its legacy is poisoned. “We want an end to mining,” she says, “but we know it can’t happen abruptly.”

Back in Germany, the mayor of Bottrop, Bernd Tischler, has been thinking about how to kick coal since at least the early 2000s, long before the federal government put an end date on the country’s mining. An urban planner by training, Tischler has a knack for long-range strategy. After he took office in 2009, Tischler thought Bottrop could reinvent itself as a hub of renewable energy and energy efficiency. He devised heating plants that run off methane collected from the coal mine, and made Bottrop the first town in the Ruhr with a planned zone for wind energy.

In 2010, Bottrop won the title of “Innovation City,” a model for what the Ruhr Valley cities could become. Bottrop now gets 40 percent of its energy from renewables, Tischler said, 10 percentage points above the national average.

Describing this transformation, Tischler makes it almost sound easy. I explain that the issue of coal seems to track larger divisions in the United States, and so discussions inevitably turn heated, emotional.

“In Bottrop, the people of course feared for the process of the end of the coal mining,” he said. But Tischler believes mining towns have an advantage that can help them adapt to change: They’re more cohesive. In the mines, people are used to working together and looking out for each other. Distrust is dangerous, even deadly.

The Ruhr cities absorbed waves of Polish, Italian, and Turkish laborers over the years. And they’ve managed to get along well, knitting a strong social fabric, Tischler said. In the past few years, Bottrop, a town of 117,000 people, has resettled thousands of Syrian refugees in new housing.

A strong social fabric isn’t enough to survive the loss of a major industry, of course. Some promising industry — technology and renewables in Bottrop’s case — has to be found to replace it.

“I think the responsibility of the mayors and the politicians is to change the fear into a new vision, a new way,” he says. “You can’t do it against your people; you have to convince your people. You have to work together with institutions and stakeholders that don’t normally work together, [so that] we are sitting in the same boat and we are rowing in the same direction.”

Reporting for this story was supported in part by the Heinrich Böll Stiftung Foundation.