I recently bought a house that has a porch light that doesn’t work. The porch light is mounted to a junction box that is installed surface-mounted to a vinyl mounting box. The junction box is loaded with silicone but I’m sure it’s still not weathertight and probably the reason for the light not working. My question is how to replace the light and ensure it’s weathertight. Do I need to drill a hole to recess the junction box within the wall, or can I still surface mount a weatherproof box with weather gaskets and silicone between the light fixture and the junction box?
Provided there is only 1 cable in that box, I recommend replacing it with a pancake box like this... https://www.homedepot.ca/product/iberville-ceiling-pan-1-2-in-deep-ko/1000106180 Once the new fixture is mounted and working, apply caulking to make it weather resistant.
The purpose of that vinyl mounting box, is to hide a proper junction box, which should be firmly mounted to the underlying wall. You shouldn't have to drill a recess for it, (well maybe for a cable clamp) but you might have to get creative if stands out too far. The pancake box suggestion is also a good idea. You can shim that out so it meets the inside of your vinyl box, and fits flush with your fixture. Then caulk it well. You'll have to open things up to figure out the details. But it shouldn't be complicated.