I made an upside-down pineapple cake. It consisted of a layer of buttered caramel, a layer of pineapple pieces, and a layer of batter, baked together. I pressed the batter between the pineapple pieces before baking, hoping that it will "flow in" and keep them in place, but the pineapple was already sunk into the caramel, and it seems to have gotten quite moist during the baking. Result: when I turned the cake, half the pineapple pieces fell off. I replaced them, but I am not sure they will stay in place, even when the caramel hardens a bit, because there is no caramel between the pineapple surface and the cake.
How could I have kept them in place?
You need to have a good amount of caramel to keep them in place. It also seems like your batter isn't runny enough. Turning it upside down immediately after coming out of the oven should help too! I cook mine in a 12 inch cast iron skillet that has been seasoned. (It can be purchased pre-seasoned at Walmart.) Here is a no fail recipe from The Pioneer Woman which I always use. I've never had a problem with the pineapple not coming out beautifully!
Instead of worrying about how well the pineapple is sticking to the cake, I'd try different pan preparations to make sure the pineapple doesn't fix itself to the pan.
Looking at the recipe that Holly linked to -- it says specifically not to stir the butter and sugar together, which I assume would give you a better separation as there's butter against the pan, and you're doing it in a pre-heated pan, which helps to prevent sticking (but normally isn't done for most other cakes, as it'll cause them to dome on top)
If you're not making the caramel in the same pan (and so you wouldn't have that layer of melted butter), I'd be inclined to use a parchment circle with another layer of fat over it, so after you invert, you'd then have to remove the parchment (which shouldn't be too bad if done quickly, before the caramel sets)
Spray your pan (cake pans, muffin tins) with butter flavored non stick spray (pans should stay cold or room temperature, do not preheat the pan) Add brown sugar (for this recipe in muffin tin, I used 1 teaspoon) first, then a thin slice(s) of butter. I am making mine in a large muffin tin (6 servings and dark coated non-stick) Add Pineapple and cherry next. Be sure to dry the pineapple off really well. Pour cake batter on top (use pineapple juice instead of water in your cake batter) Cook at 350 degrees in preheated oven. Cool for 15 minutes then flip onto a cookie sheet.
First put the butter into the pan, in chunks. Melt it in hot oven, making sure not to burn it. Gently swirl it around in the pan so it coats the sides. Then add pineapple, making whatever pretty design you like. Add nuts and cherries if using. THEN add the brown sugar. If you used enough butter, (1 stick for 9x13 pan) it will be floating around and on top of the pineapple, etc. and you can sprinkle the brown sugar all over the entire bottom of the pan. Don't worry about caramelizing it, it will caramelize while the cake bakes. Pour the batter over all and then bake. The color of the pineapple will be better if you use this method, as well, with the brown caramel below the pineapple when it is inverted to be served.