Yes, you can transplant it. Make sure the container is no more than 2 inches larger across the top than the old one is. Use a growing medium that is specially formulated for cacti and succulents ... the bag should be clearly marked as such. Do not water the cactus for a week or two before
you transplant it, and do not water it for a week or two afterward
. For cacti, the roots fare better during transplantation if everything is dry.
"Isn't it enough to see that a garden is beautiful without having to believe that there are fairies at the bottom of it too?" - Douglas Adams