Cactus can do very well in containers if attention is paid to several things. One, use terracotta, it breathes well. Also, make sure there is a hole in the bottom because the soil shouldn't be sitting in water. And importantly use a Cactus soil mix, a mix that has a lot of sand, a lot of perlite. Although most plants don't thrive in mixes with a lot of sand, because it dries too fast, Cactus requires this condition. In fact, over watering is the number one way to kill a Cactus. To place the Cactus in a new container roll up a newspaper and use it as a set of prongs. Pull the cactus out of the old container with the newspaper, set it down in it's new container. As you put the soil in make sure the top of the Cactus is not surrounded by soil because it will tend to rot and die if the base stays too moist.