Yes, that event was related to Hijrah. Here is its copy-paste
Prophet {PBUH} proceeded direct to the house of Abu Bakr who, immediately accompanied him and both set out southwards, clambered up the lofty peak of Mountain Thawr, and decided to take refuge in a cave.[Ibn Hisham 1/483; Za'd Al-Ma'ad 2/52]
Knowing already that Quraish would mobilize all its potentials to find him, he played a clever trick on them and instead of taking the road to Madinah in north side of Makkah as the polythiest would expect, he walked along a road least expected lying south of Makkah and leading to Yemen. He walked for 5 miles until he reached a rough rocky mountain called Thawr. There his shoes were worn out, some said he used to walk tiptoe in order not to leave a trail behind him. Abu Bakr [R] carried him up the mountain to a cave called after the name of the mountain, Cave Thawr. AbuBakr first entered to explore the cave and be sure that it was safe, closed all holes
with pieces torn off from his clothes, cleaned it and then asked the Prophet [pbuh] to step in. The Prophet [pbuh] went in and immediately laid his head in Abu Bakr�s lap and fell asleep. Suddenly Abu Bakr�s foot was stung by a poisonous insect. It hurt so much that his tears fell on the Prophet�s face. The Prophet [pbuh] immediately applied his saliva on Abu Bakr�s foot and the pain went off on the spot. They confined themselves to this cave for three nights, Friday, Saturday and Sunday. �Abdullah, the
son of Abu Bakr would go to see them after dusk, stay the night there, apprise them of the latest situation in Makkah, and then leave in the early morning to mix with the Makkans as usual and not to draw the least attention to his clandestine activities.
�Amir bin Fuhairah, while in the company of other shepherds of Makkah tending his master Abu Bakr�s flock, used to stole away unobserved every evening with a few goats to the cave and furnished its inmates with a plentiful supply of milk.[Bukhari 1/553}
Next Question
For how many years did Umar RA, stay as khalifa ?
Bro. Hamzah and SIs Sakeenah ? Woodstock try to answer this .
JazakAllah sisters for answering earlier question.