A Kurdish friend​ of mine in Sulaymaniyah in northern Iraq recently posted an image of a hand-drawn diagram on his Facebook page. With little arrows and stick figures and pictures of a train and boat or two, the diagram shows how to get from Turkey to the German border in twenty easy steps. After you’ve made the thousand-mile trip to western Turkey, the journey proper begins with a taxi to Izmir on the coast. An arrow points to the next stage: a boat across the Aegean to ‘a Greek island’, costing between €950 and €1200. Another boat takes you to Athens. A train – looking like a mangled caterpillar – leads to Thessaloniki. Walking, buses and two more worm-like trains take you across Macedonia to Skopje, and then through Serbia to Belgrade. A stick figure walks across the border into Hungary near the city of Szeged. Then it’s on to Budapest by taxi, and another taxi across the whole of Austria. At the bottom of the page a little blue stick figure is jumping in the air waving a flag. He has arrived in Germany, saying hello to Munich, after a journey of some three thousand miles, taking perhaps three weeks, at a total cost of $2400.

Migration is the topic of almost every conversation in the cafés of Baghdad and Damascus – in towns large and small across Syria and Iraq and beyond – along with the pros and cons of social aid given to migrants in different countries. The best routes are common knowledge, and information on new developments and up-to-date advice spreads quickly on social media, via Viber, WhatsApp and Facebook. These days all you need to reach Europe are a couple of thousand dollars and a smartphone. It’s a significant change from the late 1990s, when – in Iraq at least – UN sanctions combined with the conditions of Saddam’s dictatorship meant it was barely possible to get by, existence depending on government handouts and meagre state salaries. Few had the money to reach Europe. Tens of thousands left Iraq but most languished in dull Amman in Jordan. Most people I knew wanted to leave, and most failed – for lack of funds, will or simple luck.

I was one of those who failed. I had finished my degree in architecture and was desperate to continue my studies in Vienna or Beirut, or at least to get a half-decent job in Amman or Dubai. I was a military deserter, so I had no hope of obtaining a passport: my only way out of Iraq was by procuring fake documents or finding a smuggler. I tried for three years. I spent nearly $3000 – then a fortune – on fees to smugglers. I was lied to, betrayed, and conned out of money I had borrowed. For nine months I lived with my bags packed, ready to go, and every night I made a call to the smuggler, who kept lying and saying that the next day was the day. Eventually, I gave up and unpacked my bags and waited another five years.

For decades, the paths that led out of war, destruction and poverty into the safety of life in Europe was a closely guarded secret, the property of smugglers and mafias who controlled the routes and had a monopoly on the necessary knowledge. They conducted their illicit trade out of dingy cafés in the back streets of Aksaray in Istanbul and – for the lucky few who reached Greece – the district of Omonia in Athens, where those who had got that far were handed on from one network to another, to be lied to and manipulated again. After all, they had no choice but to hand over their cash in exchange for a promise and a hope.

This year everything changed. A trickle of migrants had always crossed the Aegean, an undesirable route not because of choppy waters and unsound boats but because of the thuggish Greek police and the remote prospect of gaining asylum in Athens. The trickle turned into a stream when the new Syriza government rewrote the rules. ‘The policy used to be: return the boats even if we put lives in danger,’ a coastguard official on Lesbos told me. ‘With this government it’s: “No, let them come in, and help them if they need help.”’ Turkey, too, was now turning a blind eye to the migrants, and the old smugglers’ networks and tightly controlled borders into Europe gave way under the weight of tens of thousands of people. Syrians previously displaced across Jordan, Lebanon and Turkey were joined by Iraqis – mostly young Sunnis fleeing Islamic State and Shia militias – along with a small percentage of Afghans, Eritreans and Pakistanis, all escaping their own conflicts, all seeking out the new routes in the hope of better lives. The mobilisation techniques used in the Arab Spring, which brought thousands of demonstrators to a given place, were now being used to organise the new waves of migration. This was no longer an exodus of the wretched and downtrodden – though many still were – but a pilgrimage, predominantly, of the young, educated and middle class. The breaking down of Europe’s borders left two groups of people angry and struggling to find a way to restore the old order: the smugglers, and EU officials.

Early​ one morning on the island of Lesbos, a short grey-haired man parked his motorbike under a pine tree and sat down on a pebbly beach littered with abandoned lifejackets – orange, red and blue. The carcases of rubber dinghies lay nearby. In the distance, on the other side of the channel, the Turkish mountains were gloomy: the day was overcast. The man came to the beach every morning, and sat and waited for the migrants’ boats to arrive. Occasionally he scanned the horizon with a pair of old military binoculars that hung from his neck. Two of his friends sat at a table they had set up a little way back, drinking coffee. They were all fishermen, but now, like many others on the island, they had become scavengers, ripping the outboard motors off the arriving dinghies. The law of the sea stipulates that you can keep whatever you find drifting in.

‘Sometimes they send them with bad Chinese engines,’ the man said, out of concern not for the migrants’ safety but for the price the find would fetch. For the three men the migrants were ‘nauseating filth’ from ‘over there’, but with each outboard motor bringing in a couple of hundred euros they were happy to form a reception committee of a sort for the new arrivals. Businesses everywhere were flourishing thanks to the current exodus. In Karaköy, the old port area in Istanbul, outdoor supply shops that until recently were clinging on through sales of a few fishing rods were suddenly doing a roaring trade peddling lifejackets and dinghy motors.

As the sun climbed higher four dots appeared on the horizon, heading out from the Turkish coast in a well-marshalled line: an operation conducted with military precision. The dots grew into boats. Three tacked to the east and one headed straight towards where the man was waiting. A single engine wasn’t anything to complain about: it was still early morning and who knew how many more would come over the course of the day? But half an hour later the boat seemed hardly to have moved. ‘Something’s wrong,’ the man told his friends. Through his binoculars he could make out red and blue dots and arms frantically waving. ‘The engine’s broken,’ he said.

The three men jumped on the motorbike and drove off to try to catch up with the boats that had headed to the east. By the time the bike caught up with them, a long train of people – men stomping under backpacks, women carrying and dragging children – was making its way into a village after climbing the cliffs below. There were a hundred of them, or a few more, the cargo of the three boats; the fourth was being towed to shore by the Greek coastguard. The men, women and children filled the village streets, taking over the pavements, resting on the grass, changing the landscape. Eventually they gathered up their belongings and started their walk to Mytilene, Lesbos’s main town, where all migrants are required to register before being taken to Athens.

The long march into Europe had begun. This was a caravan of ethnic clusters – Afghans, Arabs, Kurds – all threaded together along the tarmac. The order of the clusters changed depending on who was resting and who was moving on; sometimes they spread out over a kilometre and sometimes they came together in a mass, intimidating the tourists and the locals. Two groups of walkers met each other, travelling in opposite directions: on the one side, heading away from town and into the wilderness was a group of European pensioners – Germans and Brits – all dressed in bright outdoor gear, stout boots and T-shirts. They all looked anxious. In the other direction came the migrants, marching to the town, many leaving their countries for the first time, all tired from the dangerous crossing but endlessly chirpy, all talking about their plans for the journey ahead. They didn’t have time to admire the scenery. ‘If I was a tourist here this would have been a great place to visit,’ said a man walking with his daughter as they passed through another picturesque village and its orchards. ‘Maybe one day we could come back with your brother and sister.’

His name was Khaled. He had sad eyes and his prematurely white hair was cut short. He didn’t seem confident of what he was doing, and kept asking his daughter if she was OK. She looked about 12. She rarely responded but, unlike him, she wasn’t fazed, and just kept going. They attached themselves to a group of Syrians, but sat a few feet away and walked a little way behind. He said they were heading to Denmark, where his brother-in-law lived. He spoke in a thick Iraqi accent but said he was from Mayadin, a Syrian town close to the Iraqi border. He and his family had fled after Islamic State took control of Mayadin early in the year, but he was uncomfortable talking about the situation in his hometown. His wife, another daughter and a son were still in Turkey.

On the Greek islands, it’s forbidden to transport the ‘illegals’. They aren’t allowed on buses or in taxis – locals were threatened with fines for people smuggling – so they have to walk the forty kilometres to the registration centres. When a tall blonde Greek girl came along to offer Khaled and his daughter a ride, he looked over sheepishly at the group of Syrians and said: ‘We arrived together, it would be a shame to abandon them. We will walk on together.’ After another hour under the sun, though, the daughter was growing visibly weaker, so when the Greek girl offered a ride again he accepted. In the car, Khaled became more animated. He asked his daughter to bring out her ‘Kindle’, and she passed over a tablet to show the Greek some pictures of the rest of the family.

There were police at the gates of the port at Mytilene. It was early afternoon. Hundreds of migrants had settled in a queue; many had been here since the night before. Those still walking after the morning landings at the beach wouldn’t arrive before dark. Here, a Libyan father and five children had made a home between two parked cars. Two dozen Somalis and Afghans were at the water’s edge, though most just sat in the middle of the road. Each person had to be processed and then taken to a camp in a disused playground, where they waited before being transferred to Athens.

The Greek girl pushed through the crowds and talked her way past the police line. She came back a few minutes later and took Khaled and his daughter inside where a doctor from the International Organisation for Migration, a UN-affiliated body, inspected the girl. The doctor, an Italian woman in her fifties, had been in many places of crisis, but there was something about the way the father held his daughter’s hand that made her cry. She asked the father for his passport so she could expedite their claims. He froze, and said they didn’t have passports.

‘You’re Syrians, right?’

‘Yes.’

‘Then it won’t take long.’ The Greek shook hands with them and left them inside.

Soon afterwards, Khaled came back out and called to her.

‘I’m sorry,’ he said.

‘What happened?’ she asked.

‘I lied. I am Iraqi, not Syrian,’ he said. ‘My daughter told me it was wrong to lie to people who have been helping us. I was scared. We are Shia, and the Syrians we travelled with were all Sunnis. I’m sorry.’ It had been a sound decision to keep quiet: scuffles between ethnic groups are common. But it wasn’t the only reason to lie. Syrians get preferential treatment in most places: in Greece, they can stay in the country longer after receiving their papers – it’s one month for an Afghan, four for a Syrian.

The blonde Greek belonged to a small gang of people working to subvert EU bureaucracy. They met in a room on the ground floor of a building still under construction in a village on the outskirts of Mytilene. The gang included a florist who spent her hard-earned cash on fuel so she could ferry women and children across the hills and into the town, two doctors who had volunteered to treat the new arrivals in the morning on the beaches and smuggle them into Mytilene at night under the cover of darkness, a coastguard official who worked in the main reception centre during the day and who in the evenings when he wasn’t playing volleyball would go out to help the migrants. The leader of the gang was an imposing priest with a chest-length white beard: Father Papastratis, who walked around dragging an oxygen bottle and tubes strapped to his nostrils. He was 58 but looked 70; he had hardly any use of his lungs and had had two strokes. He smoked an occasional cigarette when his son wasn’t looking.

Long before the crowds in Budapest and Vienna started donating food and clothing to the refugees, and while the local government on Lesbos was still working out what to do, this gang of six was running its own unofficial reception centre, providing food, shelter and medicine to the new arrivals. The florist told me that many people on the island were descendants of refugees driven out of Turkey decades ago. She spoke while driving down from the hills with another family. On the back seat of her Renault a mother closed her eyes and fell asleep with a child on her lap; next to her were three more children between the ages of nine and 14. She took them into Father Papastratis’s reception centre; a man had arrived from Athens and was unloading a car packed with pots, a stove and bags of pasta. He set up a mobile kitchen as the room filled up. Costas was an anarchist who had been feeding the homeless in Athens for a couple of years. The Marxist and the Orthodox priest made an odd team.

Unlike Father Papastratis’s building, the government-run reception centre in the disused playground was a miserable place, with rubbish everywhere. Fights were breaking out between Syrians, Afghans and Somalis. Two Eritrean women were complaining of sexual harassment. The man from the coastguard – the priest’s eldest son – stood in the middle of a crowd of people all shouting demands at him: a Syrian family, the mother ill with cancer; two Afghans complaining that some Syrians wouldn’t let them charge their phones; an Afghan woman who said her child had diarrhoea and needed pills. Everyone wanted to know when they could leave the island. ‘Why are you treating us like this?’ someone asked. ‘What can I do?’ he said. ‘They want me to be their mother, their friend, their psychologist, and I’m just a coastguard: this is madness. Fuck the EU.’

Following​ the route laid out by my Facebook friend, most of these migrants would stop briefly in Athens and then travel on to Thessaloniki. It’s a six-hour walk from the train station there to the Macedonian border. Next to a deserted petrol station – used by no one, since fuel is cheaper on the other side of the border – is a two-storey motel, a place to rest, buy provisions and charge up your phone. Presumably, this place was once as deserted as the petrol station but now it was a modern-day caravanserai, the lobby stacked high with overpriced canned food, trainers, backpacks and bottled water. Two elderly Greek cooks were ladling out beans and rice for €10 a plate. Every table, chair and corner was occupied. A group of Syrians sat smoking and nattering away; next to them a table full of Eritreans drank beer in silence. The patron of the motel was charging round in a rage shouting orders, behaving as if his fine establishment had been invaded by vermin rather than clients. Business was so good that neighbouring tavernas and places with rooms to let had all hung out signs in misspelled Arabic in the hope of luring in some of the new clientele. Most of the migrants had money to spend and didn’t mind the prices. They had come with a few thousand euros, cash from houses and cars sold back home to fund the journey to Europe. Being charged €5 for a can of Coke was a trivial exploitation compared to the thousand or so euros each had had to pay for a trip on an inflatable dinghy that would have cost €15 on a ferry.

From the motel, the migrants followed a track into open fields. Thousands had been this way already and the earth was packed hard. Women in headscarves and ankle-length skirts trod carefully, shepherding their children. Behind them was a group of Syrian hipsters in Panama hats and T-shirts, university graduates from Homs and Damascus, one of them a network engineer who planned to go to Britain. There was a Somali in cowboy hat, leather trousers and a necklace; he was high on hashish and spoke in gangsta English.

There was also a Syrian family: father, mother and three little girls. Bassem, the father, was carrying the youngest girl on his shoulders. He had once been a well-off merchant in the outskirts of Damascus; his family owned a large amount of agricultural land. When the revolution began in 2011 he used his money to bankroll the fighters and became a commander in the subsequent civil war. ‘I spent $300,000 on weapons and ammunition,’ he said, ‘and I lost many friends. I regret it all.’ When his area was besieged he fled to the Bekaa Valley in Lebanon to lie low but soon got into trouble with Hizbullah. His brother was detained and he was nearly captured himself. From Lebanon he went to Turkey, where a fellow revolutionary-cum-smuggler promised to get him and his family on a ferry to Italy for €10,000. The comrade took the money and vanished. Of all the money he’d lost, he said, that hurt the most. He spoke calmly, wasn’t bitter, but said he felt ashamed that he’d had to sell his wife’s jewellery to get here, only to make his girls sleep in fields.

The Greek police had abandoned the border, having learned early on that rather than try to stop the flow it was better to let it move as quickly as possible. After all, no one wanted to stay in Greece. It would take weeks for the Macedonians to learn the same lesson. For this group of migrants, the obvious road ahead was blocked: a Land Rover and five Macedonian policemen stood in their way. So several hundred people had to move along the railway line to find a place to spend the night. Some laid out sleeping bags under a bridge, others put up improvised tents made from plastic sheets and sticks. In the morning, as more people arrived to turn the impromptu camp into a village (women from Sierra Leone, a Yemeni in a wheelchair, many more Syrians and Iraqis), a few self-appointed scouts walked up and down the border looking for a safe path. To the right of the police was a river that couldn’t be crossed and to the left there were hills which, it was said, were patrolled by bandits who were demanding €200 from anyone they came across, having ‘bought’ the area. Two young Kurds fresh from the battles of Kobani went off into the hills to see if they could find a way through. At a bend in a track just before an abandoned Greek police post, one of them spotted a path through the bushes, leading to Macedonia. Word was sent that a way had been found.

An hour later a column of people walked through the sunflower fields towards the hills, the misery of morning replaced by elation. When they reached the turning the Kurdish boys helped everyone through the bushes, and then moved to the edge of the hill to watch the Macedonian police below. They spent hours rolling and lighting cigarettes. Two police shifts were changed, a dog was brought in. ‘What if we all spread out in a line and ran at the border?’ one of the boys suggested. The idea of storming an international border seemed insane to many of the older refugees, but there was no other way, and when night fell the whole crowd ran down the hill into Macedonia.

And then it was downhill all the way to Gevgelija, the nearest town, where, in an absurd reversal of the game, the Macedonian police politely processed each migrant and gave them the necessary papers to move freely across the country. After they had waited their turn, I bumped into the Syrian hipsters at the bus station. They were talking excitedly and looking at Google Maps on their phones. ‘Next stop, Skopje,’ one said. They had their route all planned out, across Serbia, Hungary and Austria. One of them was thinking of heading for Denmark. It wouldn’t take them long.

I saw​ some of the others once more, in Lojane, a village of mostly ethnic Albanians on the Macedonian side of the border with Serbia. Here migrants would regroup and wait and try to make arrangements for the crossing of another international border, another game of cat and mouse with the police. This time things were tougher: the rumour was that it wasn’t safe for people to loiter. The village square was empty apart from a farmer with a stall of melons and tomatoes, and three old men in black caps sitting on a bench. Then a Syrian family came into the square, the father carrying a child and the mother holding the hands of two little boys. They were walking fast, at the heels of a teenage boy, an Arab, who was leading the way. They entered a narrow side street which turned into a track. They walked past a dark red Audi with no licence plates that was parked on the verge, four men sitting inside, watching them. The family headed into the woods towards Serbia. At a turn in the track they vanished. It was only when I saw another family doing much the same that I understood what was happening: they were all being guided by a previous set of migrants, people who knew the tricks of this border and who could be paid to take one safely across. The old smuggling networks were still there, ready to re-emerge at any sign of tighter border controls, to take advantage of the do-it-yourself migrants who couldn’t quite find their way.

Not​ all smugglers toil at the dirt tracks on the frontiers between nations. Nabil is a Swedish-Iraqi whose main talent is marketing. His job has been made difficult lately: who needs a smuggler if they can find their own way to Europe? He made the decision to cater for more exclusive clients, those who want to spare themselves and their families the hardship of a long trek through the Balkans.

I met him in the lobby of a hotel in Baghdad, having told him I might need his services. His hair was dyed jet black and gelled. He wore a blue shirt with white polka dots, a pair of Ray-Bans hanging at his chest. He had told a friend of mine before our meeting that he dressed like a European to impress his clients.

‘So, do you want to humiliate yourself by travelling to Europe on foot?’ he asked me. ‘Or’ – the salesman’s pitch winding up – ‘would you prefer a guaranteed way to get a Swedish passport inside two years?’ For the sum of just ‘four bundles’ – a bundle is $10,000 – he could arrange for one of his lady friends in Malmö to marry me. (‘We have to pay her a bundle in advance.’) There would be a wedding in Baghdad, with pictures. ‘Then once you get your visa, arranged through a contact at the Swedish embassy in a neighbouring country, you pay us another bundle and a half. Once in Sweden you settle down and relax. The government will give you a house and a salary. Just sit and wait and they’ll hand you your passport in a year or two.’

‘What if I pay you the money and I don’t get the passport?’ I asked.

‘I guarantee you a passport. I’ve done the same for a lot of people.’

‘What if I give your friend the money and she doesn’t turn up for the wedding?’

‘I am your guarantor,’ he assured me.

There was, he said, a cheaper option, which could be arranged through a network of corrupt officials at one of the European embassies in Baghdad, the Italian and the Polish being the best bets. ‘We can get you a Schengen visa that way but we can’t guarantee you a passport afterwards.’ The dodgy visa would cost me a mere $18,000.