In one narration the words are: "Emigration (hijrah) is that you keep away from indecencies, those of them that are open and those that are hidden, and that you establish the prayer and pay the zakah; then you have become an emigrant."
Ahmad and al-Bazzar recorded it. One of Ahmad's two chains is hasan (good). Al-Tabarani (also) recorded it.
Hadith Referenceمجمع الزوائد ومنبع الفوائد / كتاب الجهاد / 9289