If a community builds a masjid on a land, then they decide to build another masjid on that very land, will it be permissible to convert the initial masjid into something else besides a masjid, e.g. madrasa, a place for children, etc.?
بِسْمِ اللهِ الرَّحْمنِ الرَّحِيْم
In the name of Allah, the Most Gracious, the Most Merciful
After a place has been designated as a masjid, it will remain a masjid until the Day of Judgement, and it will be impermissible to convert it into something else. Alternatively, the community may expand the current masjid if there is a need for more space.
Raddul Muhtar: v. 6, p. 548 (Maktaba Imdadia)
Fatawa Darul Uloom Zakariyya: v. 4, p. 666 (Zamzam)