In those days Caesar Augustus issued a decree that a census should be taken of the entire Roman world. (This was the first census that took place while Quirinius was governor of Syria.) And everyone went to his own town to register.
So Joseph also went up from the town of Nazareth in Galilee to Judea, to Bethlehem the town of David, because he belonged to the house and line of David. He went there to register with Mary, who was pledged to be married to him and was expecting a child.
Micah 5:2
But you, Bethlehem Ephrathah,
though you are small among the clans of Judah,
out of you will come for me
one who will be ruler over Israel,
whose origins are from of old,
from ancient times.