In a large food processor, pulse the butter, cream cheese, sour cream, salt, and flour until the dough forms chunks that clump together when you squeeze them, about 30 seconds or so.
Divide the dough into three equal amounts and shape into discs, wrapping each disc in plastic wrap. Chill for at least 60 minutes in the fridge or up to 1 day.
Add the brown sugar, granulated sugar, walnuts, raisins, and cinnamon to food processor and pulse until finely chopped. Transfer to a separate bowl.
Add the apricot preserves to the food processor, if using, and puree.
When ready to assemble, line two baking sheets with parchment paper and preheat the oven to 350 degrees F.
Roll out ⅓ of the rugelach dough at a time on a lightly floured surface to form a 10-inch circle.
Brush with ⅓ of the pureed apricot preserves, if using, or brush lightly with water if you opt not to use the preserves.
Sprinkle ⅓ of the filling mixture evenly over the rugelach dough, spreading it all the way to the edges of the circle. Pat down so the filling is somewhat compact.
Use a pizza cutter or sharp knife to cut slice the dough into 12 equally-sized wedges, just like cutting a pizza. Roll up each wedge from the wide end into the center of the dough, then transfer to a baking sheet lined with parchment paper, placing the point-side down.
Repeat with the remaining dough, preserves, and filling.
Bake for 25-30 minutes until the rugelach is a light golden brown. Some of the filling will ooze out, but it caramelizes the bottom of each piece of rugelach, giving it a wonderful texture. I just break off any unsightly puddles of filling after the baked rugelach have cooled for 10 minutes or so.
The rugelach can be served warm or at room temperature. Store uneaten rugelach in an airtight container for up to 5 days or freeze for up to 2 months.