Question: how to transfer whatsapp messages from iphone 7 to iphone xs?
Answer: Make sure you have iCloud backup function for iPhone enabled on both your phones. ... 
Then on your old iPhone, go to WhatsApp, tap > Chat settings > Chat backup and click on Back Up Now.
Now get your iPhone XS and install WhatsApp on it.