All perfect praise be to Allah the Lord of the Worlds. May Allah`s peace and blessings be upon our Prophet Mohammad and upon all his family and companions.
The obligation of fasting Ramadan is established for a Muslim upon the confirmation of the crescent of the blessed month of Ramadan, according to the Almighty's statement {which means}: "So whoever among you witnesses the month, let him fast it." [Al-Baqarah/185]. The confirmation of the crescent is established by its sighting after sunset on the 29th day of Sha'ban, and thereby it is judged that the month of Ramadan has commenced, based on his ﷺ statement: (Fast upon sighting it [the crescent] and break the fast upon sighting it...) [Narrated by Al-Bukhari and Muslim]. If sighting is not achieved, one proceeds to completing the month of Sha'ban as thirty days, due to what is mentioned in the continuation of the aforementioned hadith: (And if it is obscured to you, then complete the count of Sha'ban as thirty).
The issue presented in the question pertains to what scholars term the issue of (differing lunar rising points). The meaning of this is: the difference in the time of the crescent's birth and sighting from one country to another. This results in a difference in the commencement of the lunar month between countries, and consequently, a change in the beginning of the month of Ramadan. The jurists have differed regarding the ruling on this matter.
The Shafi'i school has adopted the opinion of differing rising points, meaning that each country has its own specific rising point concerning the crescent. Based on this, the beginning of the lunar month differs from one country to another. Shaykh al-Islam, Imam Al-Nawawi, may Allah have mercy on him, said: "If the crescent of Ramadan is sighted in one country and not sighted in another, then if the countries are close in proximity, their ruling is the same as that of a single country. But if they are distant, there are two opinions: the more correct of which is that fasting is not obligatory upon the people of the other country" [Rawdat al-Talibin, Vol. 2/P.384].
It is obligatory upon a Muslim to fast, when the beginning of Ramadan is confirmed while he is in a country, with the people of that country, and to break his fast upon the beginning of Eid with the people of the country in which he is present as well. This is based on the narration from Abu Hurayrah that the Prophet ﷺ said: (The fast is the day when you all fast, and the breaking of the fast is the day when you all break the fast, and the sacrifice is the day when you all sacrifice). At-Tirmidhi said: "This is a Hasan Gharib Hadith, and some scholars interpreted this hadith, stating that its meaning is that fasting and breaking the fast are with the congregation and the general body of the people."
Concerning the one who travels from a country where the sighting of the crescent of Ramadan was confirmed to a country where it was not: it is obligatory upon him to adhere to fasting with the country in which he was present when the time for fasting began. He should thus intend to fast during the night and commence fasting, and he continues his fast even if he arrives in the other country where the sighting of the crescent was not confirmed.
It is mentioned in the book [I'anat al-Talibin, Vol. 3/P.384] from the Shafi'i school: "If one moves at the beginning of the month from a place where they sighted it to a place where they did not, he does not break his fast with them on that day."
However, if he commences travel from this country before the second dawn (al-fajr al-thani), or true dawn (al-fajr al-ṣādiq), he may avail himself of the concession for travel and break his fast on that day. Conversely, the one who wakes up in a country where the sighting of the crescent of Ramadan was not confirmed, he adheres to the sighting of the country from which he traveled, and thus he does not fast that day. But, if he travels during the daytime to a country where the sighting of the crescent of Ramadan was confirmed, he must abstain from things that break the fast upon arrival in that country during the daytime.
It is mentioned in [Mughni al-Muhtaj, Vol. 2/P.146] from the Shafi'i school: "According to the most correct opinion: if someone wakes up on the day of Eid (i.e., in a place not fasting) and then his ship, for example, sails to a distant country whose inhabitants are fasting, the most correct view is that he must abstain from things that break fast for the remainder of the day out of obligation, for the reasons previously mentioned."
In conclusion, whoever travels before the break of dawn in a country where the sighting was confirmed, it is obligatory upon him to fast that day in accordance with the people of that country. If he breaks his fast due to the concession of travel, he must make it up later. But, if he arrives in the country where the sighting was not confirmed, he must abstain (from food, drink, etc.) and not break his fast. And Allah the Almighty knows best.