Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:17:76

And indeed, they were about to drive you from the land to evict you therefrom. And then ˹when they do˺, they will not remain ˹there˺ after you, except for a little.  

When the Jews said to him, ‘If you are a prophet, then make your way to Syria, for it is the land of prophets’, the following was revealed: And indeed (wa-in, ˹the particle in is˺ softened) they were about to provoke you out of the land, the land of Medina, to expel you from it, but then, had they expelled you, they would not have remained after you, in it, except a little ˹while˺, after which they would have been destroyed.
القرآن:١٧:٧٦

وَإِنْ كَادُوا لَيَسْتَفِزُّونَكَ مِنَ الْأَرْضِ لِيُخْرِجُوكَ مِنْهَا ۖ وَإِذًا لَا يَلْبَثُونَ خِلَافَكَ إِلَّا قَلِيلًا  

ونزل لما قال له اليهود: إن كنت نبيا فالحق بالشام فإنها أرض الأنبياء {وإن} مخففة {كادوا ليستفزونك من الأرض} أرض المدينة {ليخرجوك منها وإذا} لو أخرجوك {لا يلبثون خلافك} فيها {إلا قليلاً} ثم يهلكون.