Barrel cactus types come in various shapes and sizes. Smaller cacti grown in pots indoors are much easier to transplant than large outdoor specimens.
Small Barrel Cacti
Small barrel cacti have shallow root systems so it is easy to loosen them in their pots. It is enough to wrap the cactus in folded newspaper to protect you and the spines. To remove from the original pot simply tip the pot on its side with the cactus on the newspaper and loosen the soil. The cactus can be lifted with the newspaper and tipped into the new prepared pot.
Mature Outdoor Specimens
Wrap the cactus in thick foam pads to protect the spines. The shallow root system needs to be exposed. The root system will be about twice the diameter of the plant so take this into account. Once the roots have been exposed lever the cactus out of the hole after marking the side that faces a particular fixed distant object. This will enable you to replace the cactus in the ground so that it faces the same direction so that previously sun protected areas of the cactus will not be burned.
A barrel cactus is surprisingly heavy so it might require two people to handle one comfortably. Before replanting cut off any damaged roots and allow the remaining roots to dry in the air for two or three days.