Preheat a skillet over medium heat.
Spread 1 tablespoon of pesto evenly on one side of each slice of sourdough bread.
Layer the fresh mozzarella slices on top of the pesto on one slice of bread. Season with salt and pepper.
Place the other slice of bread on top, pesto side down, to form a sandwich.
Melt 1 tablespoon of butter in the preheated skillet.
Carefully place the sandwich in the skillet and cook for about 3-4 minutes, or until the bottom is golden brown.
Flip the sandwich and cook for another 3-4 minutes, adding more butter if needed, until the cheese is melted and the other side is golden brown.
Remove from the skillet, let cool for a minute, then slice in half and serve warm.