I did it in different ways.
For the aft cabins i purchased medium density foam RG 50/40 in the same thickness as the old ones in pieces of 2000x1000mm and cutted them to same shape as the old pieces, using an electric kitchen knife. As the covers where pretty good, my first mate put them into the washing machine (30°C) and we fitted them again. In the aft cabin we had no chance for fitting higher mattresses due to the cusions in front of the lockers, which have the same height like the mattresses and will block lockers doors, if higher.
For owners cabin (in bow cabin) we got new, higher and far better mattresses. I'm a pretty skinny guy with 130kg and have some trouble with my back, i bought pretty firm mattresses (as suggested by my orthopedist), put them into my bed at home and checked them over 3 months. After prooving them, i put them on the boat, cut them to shape, using the old mattresses as a template and my first mate sewed new covers, using the original new covers by cutting away the excess fabric and leaving the original zipper in place. If the mattress cover needs cleaning, we can remove it using the existing zipper. Really fine resting in our bed now.....