Whenever Messenger of Allah ﷺ left for Mecca, he used to pray in the mosque of Ash-Shajra, and when he returned (to Medina), he used to pray in the middle of the valley of Dhul-Hulaifa and used to pass the night there till morning.
أَنَّ رَسُولَ اللَّهِ ﷺ كَانَ إِذَا خَرَجَ إِلَى مَكَّةَ يُصَلِّي فِي مَسْجِدِ الشَّجَرَةِ وَإِذَا رَجَعَ صَلَّى بِذِي الْحُلَيْفَةِ بِبَطْنِ الْوَادِي وَبَاتَ حَتَّى يُصْبِحَ