Place the slices of dough next to each other and allow to thaw. Peel onions and garlic and dice finely. Peel, wash and roughly dice the potatoes. Heat butter in a pot. Fry onions and garlic in it until transparent. Add potatoes and steam briefly. Dust with flour and sauté until light brown. Stir in milk and 100 ml water, bring to the boil and simmer covered for about 10 minutes.
Cut the ham into coarse cubes, add to the sauce and simmer for another 5 minutes. Wash the chives and chop finely. Season to taste with salt and pepper.
Pour the potato mixture into an ovenproof dish (approx. 18 x 30 cm). Place the dough plates next to each other, slightly overlapping, on some flour and roll out to the size of the baking dish. Cover the casserole with it. Bake in a preheated oven (electric cooker: 200 °C/circulating air: 180 °C/gas: see manufacturer) for approx. 30 minutes.