It was the warmest of welcomes: as thousands of refugees and migrants arrived at train stations across Germany last week, they were greeted with applause and singing by crowds of German locals who had gathered for their arrival, bearing supplies, food and good wishes.

As video footage of the various arrivals spread across the Internet, the heartwarming greeting was lauded as an example for the rest of Europe. Instead of refusing to allow the desperate migrants in, many of whom are fleeing war-torn countries, Germany — along with Sweden — has announced or maintained generous policies. Germany has taken in more than 99,000 refugees so far this year, with tens of thousands in the last week alone. The incoming numbers were so great, that Germany announced on Sept. 12 that it was introducing temporary border controls — not to keep migrants out, but to stem the overwhelming tide and maintain order. Even so, German Chancellor Angela Merkel has said that they could welcome a million in total by the end of the year. Meanwhile, Sweden has already accepted 65,000 refugees this year and has taken in more lone children refugees relative to its population than any other European country.

In contrast to German hospitality, critics say the rest of Europe has refused to do its share. Britain has committed to accepting only 4,000 refugees a year until 2020. Hungary has built a wall along one of its borders to keep migrants out, while the Netherlands has instituted some border controls. Slovakia has taken in a mere 61 Syrians fleeing the conflict at home, and its government has insisted that it only wants to take “Christian refugees.”

But while Germany and Sweden have made commitments to take in hundreds of thousands of refugees between them, opening their doors is just the start of a much longer process.

“These people will need more of course than a warm pullover and a warm welcome,” Norbert Trosien, an associate protection officer with the U.N. High Commissioner for Refugees (UNHCR) in Berlin, tells TIME. “They’ll need to be accepted also in the long run.”

It’s a task that’s already weighing on the minds of officials. On Sept. 8, Germany’s interior minister Thomas de Maizière said in parliament, “Let’s not deny that great challenges will follow on our initial friendly welcome of the newcomers — challenges that will have to be met in everyday life.”

The immediate cost of absorbing the asylum-seekers alone is enormous. Asylum-seekers will be placed around the country and applications for their asylum need to be processed, which, in Germany, will take an average of 5.3 months to complete. Both Sweden and Germany provide refugees with housing, government allowances and language lessons, all of which comes at a cost to the state. Germany has already announced that it has allocated $6.6 billion to cope with the incoming refugees and migrants.

Then comes the stickier matter of long-term integration. Language and cultural differences could potentially lead to roadblocks for many refugees hoping to fully settle in their new homes—at least right away. In Sweden, it can take foreigners with a non-E.U. background years to find work. Even after years in the country, immigrants in Sweden are far more likely to be unemployed than their Swedish counterparts.

In Germany, foreigners also face challenges when it comes to integrating. A 2009 study by the Berlin Institute for Population and Development found that the immigrant groups in the country who were least integrated with German society tended to be worse educated, worse paid and had a higher rate of unemployment than native Germans and groups that had integrated better (mostly western Europeans).

And then there’s the cultural backlash. Despite the warm welcome at train stations, German officials have reported more than 200 attacks on asylum-seekers and facilities meant to help them this year, with another suspected arson attack on a refugee center reported on Sept. 8 in Rockensussra.

Though Sweden has had a generous policy on immigration for years, the far-right, anti-immigrant political party the Sweden Democrats has risen in approval polls to 25% in recent months. There has also been a rise in racist and xenophobic attacks in the country. Earlier this year, three mosques around Sweden were firebombed within a month. In August, after a mother and son were stabbed to death in an Ikea store in the Swedish city of Vasteras, allegedly by an Eritrean asylum-seeker, there were several reported attacks on nearby asylum centers.

But the influx of migrants and refugees also has its upsides. Across Europe, countries are grappling with aging populations and declining birth rates. According to the UNHCR, in 2013, 51% of refugees across the globe were under 18 years old. As Morgan Johansson, Sweden’s justice and migration minister, said in an interview with The Daily Telegraph, “More people are growing older and older and that means that in the long run we need people.” By welcoming high numbers of refugees in, Germany and Sweden could avert a demographic crisis as their workforce ages into retirement.

So what needs to be done to ease integration for migrants and refugees? According to UNHCR’s Trosien, governments are already working to increase and expand their resources for the influx of newcomers. But, he says, successful integration will also come down to how much civil society will continue to welcome and support the migrants, ensuring that they don’t feel isolated in their new homes.

“We have seen a lot of pictures of people welcoming refugees right now and being very receptive and very welcoming,” he says. “I think what is very crucial that this wave of solidarity is converted into more long-term engagement.”

Get The Brief. Sign up to receive the top stories you need to know right now. Please enter a valid email address. Sign Up Now Check the box if you do not wish to receive promotional offers via email from TIME. You can unsubscribe at any time. By signing up you are agreeing to our Terms of Use and Privacy Policy . This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. Thank you! For your security, we've sent a confirmation email to the address you entered. Click the link to confirm your subscription and begin receiving our newsletters. If you don't get the confirmation within 10 minutes, please check your spam folder.

Contact us at letters@time.com.