Heat a small cast iron skillet over high heat.
Place the dried ancho chiles and guajillo chiles in the skillet and cook briefly to blister the skins.
Remove the chiles and place in a bowl of hot water for 20 minutes.
In a blender, combine the onion, garlic, chipotle pepper and sauce, achiote paste, Mexican oregano, cumin, chicken stock, vinegar, and pineapple juice.
Remove the stems and seeds from the chiles and add them to the blender.
Blend on high speed for at least 1 minute or until the ingredients are pureed smooth.
Heat the avocado oil in a large saucepan over medium heat.
Slowly pour the blender ingredients into the saucepan.
Simmer for 15 minutes. Allow to cool 5 minutes before spreading on the ham.
Place the ham on a rack inside of a large baking dish. Coat the outside of the ham with the sauce. It will be thick and some will drip into the pan. That's okay, it will be used during basting.
Add 2 cups of water to the bottom of the baking dish.
Place the pineapple rings onto the ham and secure with toothpicks.
Cover and refrigerate for 3 hours.
Preheat the oven to 325℉.
Bake the ham, covered for 90 minutes.
Remove the foil, generously baste the ham with the sauce, and bake for 15 minutes.
Baste the ham again and continue baking for 15 minutes.
Baste the ham for the third time, and continue baking for 15 minutes or until the internal temperature of the ham is 140℉.
Remove the ham from the oven, tent with foil and allow to rest for 15 minutes before serving.
Serve slices with a drizzle of al pastor sauce over the top and a slice of pineapple.