Make sure ALL of the foam is carefully scraped off the backing board or you will have a lumpy finished product. Carefully use a razor blade on edge and a wire brush. Any existing cracks can be retaped back together with a good quality duct tape.
3M has a spray on contact cement,#77 I believe. Spray it on the headliner material and on the backer. Let set up per the instructions and then CAREFULLY roll onto the backer and smooth out with your hand. ONCE it touches you're STUCK so be carefull and be centered and lined up. Be sure to leave plenty of excess around the edges for trimming. You can cut it back but you can't grow it once its cut! Relatively easy process - good luck!
Nothing goes between the liner and the roof. However, if your headliner deformed and sagged you need som e heavy duty HIGH HEAT double sided tape or the heat will cause it to come undone. Try the doublesided tape used for car emblems or see of they have any velcro at a body shop supply.
Easiest way to get the old foam off is to peel all the clothe off then use 80 grit and a DA. It'll clean it all up in about 5 minutes. You just need to remove the old foam not all of the old adhesive. You can use the 80 grit and hand sand it as well, it'll just take longer.
I use DAP weldwood or vinyl top contact adhesive.
I have found the 3M stuff fails after a few years (or less)
Apply the DAP adhesive to both contact areas (liner board and the material) let dry just until it is no longer tacky to the touch. apply the liner to the board.
DAP Weldwood is good stuff. I had a problem though by putting it on the fabric. My fabric had the foam already on the back and it chemically melted some of the foam in a coupla places. I was able to fluff it up a bit but to do it again, I'd put an even coat on the backing board only. Used 2 liter Coke bottles as rolling pins and smoothed it, applying it from the center outward with the wife helping hold the fabric off the glue. Only do this with plenty of ventilation; that stuff will make you dizzy and being near a gas water heater is also a no-no.