The pesuk that commands us to take the arba minim on Sukkot (Vayikra 23:40) is enigmatic. It describes the mitzva as commanding us to take the four species on “the first day [of the holiday]” and then continues that you should “rejoice before God for seven days.”
There is a difference of opinion amongst the rishonim regarding the definition of mikdash in this case. Rashi, the Ritva and others explain that anyplace outside of the Temple – including the Old City of Jerusalem – is considered medinah and the lulav is not taken there. The Rambam rules that the holiness of the Temple extends to the entire city and therefore all of Jerusalem is considered mikdash for this purpose. The Jerusalem Talmud is clear on this point, in agreement with the Rambam. Thus it is possible even today that there is a biblical obligation to take the arba minim when visiting the Old City of Jerusalem.
This rule was changed with the destruction of the Temple. At that time Rabban Yohanan ben Zakkai instituted a Rabbinic decree obligating the lulav and etrog to be taken for all seven days of the holiday, zekher la-mikdash – as a remembrance of the Temple and its unique rule.
The Me’iri points out that Rabban Yohanan ben Zakkai did not actually establish the mitzva for all seven days as in the Temple, since at least one of the days will fall out on Shabbat, when, nowadays, the lulav is not taken. Nevertheless the point is that the obligation as it was practiced in the Beit HaMikdash is remembered.