It is a common science fiction plot. The planet is becoming increasingly uninhabitable, either because of self-destruction from the inhabitants or a dying sun. So a giant spaceship is built to transport some of the inhabitants across the vastness of Space to a new and better planet. This concept is becoming science.
A team of researchers at Washington State University have named 24 planets in other star systems as being "super-habitable," meaning they are likely to have liquid water and an atmosphere that could sustain life, possibly for longer than our planet Earth. These planets are all at least 100 light years away, too far for any precise analysis. The exercise is really more about finding planets that might contain life forms rather than actually being hospitable to humans. Regardless, there is no known engineering that would be capable of getting a spaceship to a planet so far away.