Shaykh al-Islām was asked:
If someone establishing an endowment or making a vow dedicates something, then considers something else more beneficial to the endowment’s beneficiary, may he replace it, as in the case of an Eid sacrifice?
He replied:
As for replacing something dedicated by vow or as an endowment with something better, as with replacing a sacrificial offering, this falls into two categories.
The first is replacement because of need: when something ceases to serve its purpose, it is sold and the proceeds are used to purchase a substitute. For example, if a horse endowed for military campaigns can no longer be used for that purpose, it is sold and the proceeds are used to purchase a substitute. Likewise, if the area surrounding a mosque falls into ruin, its materials and fittings may be transferred elsewhere, or it may be sold and the proceeds used to purchase a substitute. Or, if the endowment cannot benefit its designated recipient in accordance with the endower’s purpose, it is sold and the proceeds are used to purchase a substitute. If it falls into ruin and cannot be restored, its plot of land is sold and the proceeds are used to purchase a replacement.
All of this is permissible, for when the original property no longer fulfils its intended purpose, its substitute takes its place.
The second is replacement to secure a greater benefit. Examples include replacing a sacrificial offering with a better one, or building another mosque that better serves the townspeople in place of an existing mosque, and selling the original. This and similar replacements are permissible according to Ahmad and other scholars. Ahmad cited as evidence the fact that ʿUmar ibn al-Khattāb—may Allah be pleased with him—relocated the old mosque of Kūfah, and its former site became a market for date sellers. This constituted replacing the mosque’s site.