Reference: Fataawa al-Lajnah ad-Daa.imah lil-Buhooth al-‘Ilmiyyah wal-Iftaa., – Volume 6, Page 230, Question No.2, Fatwa No.6397
Question: What is the ruling on demolishing a masjid and then rebuilding it, or moving it to a nearby place?
Response: The base ruling is the permissibility of this, so long as it is done for Shar’ee (Islaamically legal) reasons and has a clear Islaamic advantage.
And with Allaah lies all success and may Allaah send prayers and salutations upon our Prophet Muhammad ﷺ and his family and his companions.