We should have a million years or so at our disposal to escape this galaxy. We need not find another physical world unless it was desired by some colonies of Earth-born refugees or, most likely, their descendants. Another option could be a MacroLife  habitat that could travel in search of still safer locations in the Universe to better position themselves until the next galaxy approaches millennia from then.
Thank God our star, the Sun, is close to the edge of the galactic spiral. Our intelligent species, man the thinker, is ideally placed and equipped to avoid the pre-collision effects of the two galaxies' first gravitational impact if decisions are made now on a global scale. If not it be harder, but there have always been those who have been designated a remnant when the fate of civilization or culture where seemingly in their death throes, e.g., the fall of the Roman empire and the dark Middle Ages were both balanced by the culture and science of Asian and Arab cultures.
In more recent times the Adventist movement which began around 1844 has become a worldwide force. Historically Seventh-day Adventists, emulating the model of the Israelites of antiquity, also consider themselves a cultural and cosmological remnant. More to the subject at hand, however, is the raison d'etre of the Adventist Futurists who envision man's future not on this endangered world, but beyond the approaching dangers of our Milky Way galaxy.
If the knowledge required to transcend our at-risk galaxy is not currently available it will come. Had the Greek intellectuals of Plato's and Hippocrates's culture known we could now reattach severed hands and even male reproductive organs we would be considered demigods indeed. One need not dwell too much on the seemingly impossible and improbable accomplishment of visiting another world, the moon, and returning safely, as well as more current history of sending our robotic extensions to gather information and to monitor weather patterns around far-flung worlds of our solar system.
With each passing year astronomers are finding a cornucopia of exotic worlds beyond our solar system. The speed of all this progress in science is the basis for my conjecture that a million years is ample time to overcome challenges of speed, energy requirements and other extra-galactic travel requirements.
- Association of Universities for Research in Astronomy. 21 October 1997
- This is an educated as well as an optimistic guess. The dinosaurs had between 140 and 160 million years [http://dml.cmnh.org/1995Apr/msg00178.html] to avoid their doom and did nothing due to mental limitations it would appear. Man the thinker might be more intelligent in comparison to our reptilian cousins but we might not be as hardy. Nevertheless, we appear to be blessed or fated--depending on your personal beliefs--to thrive not only on this world, but on others in contrast to the Earth-bound dinosaur species. As a personal wish one would hope at least some future intergalactic refugees take along both ostrich and crocodile frozen embryos so that some descendants of the dinosaurs might also live beyond the sun that warmed their ancestors.
- Macrolife, Space Colonization & Adventist Futurism