http://revach.net/article.php?id=1909

Section: Halacha   Category: Tshuvos
Btzel Hachochma: Taking Seforim Out of Eretz Yisroel
The Yerushalmi in Sanhedrin (3:9) says that Seforim which Eretz Yisroel acquired cannot be taken to Chutz La'Aretz unless they were written with the intention of taking them out.  The Mareh HaPanim says this issur extends to all seforim and not just Sifrei Torah.  The Btzel HaChochma brings form poskim (1:77) that this only applies to Gemaros and Midrashim which are words of Chazal but Meforshim that deal with Psak Halacha are probably not included in this issur.  In Yerushalayim however there is a minhag not to take out any sefer that came into the city unless there was a clear intention to take it out at a later time.

The reason for this Halacha says the Bzel HaChochma is because of Yishuv Eretz Yisroel. There should always be plenty of Seforim in Eretz Yisroel.  Therefore he says if someone is leaving Eretz Yisroel with the intention of coming back he may take his seforim with him. Additionally he say, if someone printed a Sefer in Eretz Yisroel to sell to the general public, if the purchaser bought it with the intention of taking it to Chutz La'Aretz he may do so because the publisher had in mind each buyer can take it wherever he wants.

The Ridvaz says that Rif, Rambam, and Shulchan Aruch do not bring down this halacha and explains that the issur doesn't apply anymore since seforim are not as rare as they were in the times of the Yerushalmi.  However says the Btzel HaChochma since many Rishonim and Acharonim pasken that the issur is still intact, it is suggested to beware of it.

Disclaimer: We try to convey the Tshuva to the best of our ability. We admit that our understanding may not be accurate. Please also understand that this Tshuva may not be the final word on this topic. One should consult a Rav before drawing any conclusions.