Try removing baby safety cabinet locks first without removing the foam backing.
You can dissolve the foam backing with constant application of WD-40 and scrubbing with a wet wash cloth. We had put some of that baby safe lock on an old apartment cabinet once and I found that by spraying it with WD-40 and scrubbing it, I was able to remove the foam tape and residue easily without removing any underlying paint or finish.
Child cupboard locks prevent baby hide in the cabinet and protect you cabinet don't be damage.