It is often assumed that at the end of an experiment when the animal is not longer useful, painlessly killing the animals is pretty much the only option. However increasing numbers of researchers are finding ways to rehome or retire research animals. One example if the Kindness Ranch sanctuary for ex-research animals, currently housing dogs, cats, pigs and horses. For relatively short-lived animals such a within-lab retirement cage is also sometimes an option, allowing animals to be euthanised according to the original meaning of the word--when it is in their own best interests.
You can see some blog posts by visitors to the sanctuary here and (briefly) here.