They didn't stay in the barn very long.
UP122 §8 ¶3 The next day after the birth of Jesus, Joseph made his enrollment. Meeting a man they had talked with two nights previously at Jericho,
Joseph was taken by him to a well-to-do friend who had a room at the inn, and who said he would gladly exchange quarters with the Nazareth couple.
That afternoon they moved up to the inn, where they lived for almost three weeks until they found lodgings in the home of a distant relative of Joseph.
The second day after the birth of Jesus, Mary sent word to Elizabeth that her child had come and received word in return inviting Joseph up to Jerusalem to talk over all their affairs with Zacharias. The following week Joseph went to Jerusalem to confer with Zacharias. Both Zacharias and Elizabeth had become possessed with the sincere conviction that Jesus was indeed to become the Jewish deliverer, the Messiah, and that their son John was to be his chief of aides, his right-hand man of destiny. And since Mary held these same ideas, it was not difficult to prevail upon Joseph to remain in Bethlehem, the City of David, so that Jesus might grow up to become the successor of David on the throne of all Israel. Accordingly, they remained in Bethlehem more than a year, Joseph meantime working some at his carpenter’s trade.