My mom, a totally certified Cacti expert, said wrap the thing in foam, then take a plastic bag, lift it out of the pot, and put it in a new one.Yup, that's what's recommended. I'm too dumb for that though, so I got stabbed a bunch of times. Said F it, and repotted it with my bare hands, only got stabbed once
Barrel cacti are a PITA to repot