Preheat the oven to 180°C/350°F. Spread the beetroot and onions on two separate baking trays. Drizzle 1 tablespoon of olive oil over each tray and toss to coat.
Roast the onions for 40 minutes and the beetroot for 1 hour, until both are tender. Remove and allow to cool slightly.
Whilst the vegetables are roasting, make the pastry. In a food processor, briefly pulse the flours and salt. Add the butter and pulse until the mixture resembles breadcrumbs. Add the water and pulse until the dough just comes together. Do not over-mix.
Wrap the pastry in cling film and refrigerate for at least 30 minutes whilst the vegetables finish roasting.
Put the sugar and balsamic vinegar in a small saucepan and simmer for about 5 minutes until it becomes thick and syrupy. Swirl the pan occasionally. Set aside.
On a lightly floured surface, roll the pastry into a rustic round shape about 30-35cm in diameter. Transfer to a baking tray lined with baking paper.
Toss the roasted beetroot and onions together with the thyme leaves. Arrange the vegetables in the centre of the pastry, leaving a 5-6cm border around the edges.
Drizzle the balsamic syrup over the vegetables and season generously with salt and pepper.
Fold the pastry edges over the filling, pleating as you go to create a rustic edge. Brush the pastry with beaten egg (for a golden finish) or melted butter.
Bake for 25-30 minutes until the pastry is golden brown and crisp.
Remove from the oven and shave the goats cheese over the top whilst still warm. Serve warm or allow to cool completely.