It has been narrated on the authority of Ibn 'Umar who said
The Messenger of Allah (ﷺ) forbade that one should travel to the land of the enemy taking the Qur'an with him.
It has been narrated on the authority of Abdullah b. Umar that the Messenger of Allah (ﷺ) used to forbid that one should travel to the land of the enemy taking the Qur'an (with him) lest it should fall into the hands of the enemy.
It has been narrated on the authority of Ibn 'Umar that the Messenger of Allah (ﷺ) said
Do not take the Qur'an on a journey with you , for I am afraid lost it should fall into the hands of the enemy. Ayyub (one of the narrators in the chain of transmitters) said : The enemy may seize it and may quarrel with you over it.
The above hadith has been narrated through several other chains with slight differences of wording.