Melt butter in a medium saucepan over medium-low heat. Add shallots, onion, cherries, and thyme. Cover, and cook until shallots and onion are soft and beginning to caramelize, 12 to 14 minutes. Stir in sugar. Continue to cook, covered, until shallots and onion are caramelized, 10 to 12 minutes.
Add vinegar and 1/4 cup warm water. Cook, uncovered, stirring occasionally, until the liquid has evaporated and mixture is deep brown, about 1 hour. Season with salt and pepper. Serve at room temperature. Confit can be refrigerated in an airtight container, up to 1 week.