Wa alaykum salam wa rahmatuLlahi wa barakatuHu,
According to the relied-upon opinion in the Shafi’i Madhhab, it is unlawful to move a body from one place to another. Rather, the community should hasten to burying the deceased in the place where he passed away.
However, there may be reasons for relocating. Ibn Hajar mentioned that if concealing a grave in a non-Muslim land cannot be done and it is feared that it may be exhumed, then in such a case it may be relocated for burial. (Tuhfat al-Muhtaj 3/202) Also, some of the As-hab al-Awjuh held that moving the deceased, when there is a good reason to (ar: maslahah), is allowed. This is the ikhtiyar of al-Qaffal al-Marwazi and also the opinion of Taqi al-Din al-Subki. (Halabiyyat 459)
And Allah knows best.
Answered by: Shaykh Yaqub Abdurrahman