Connect both your old iPhone and new iPhone in charge and Wi-Fi connection. On your old iPhone, go to Settings >[Your Name] > Tap iCloud. Turn on iCloud Backup (for iOS 10 & ealier: Settings > iCloud > Storage & Backup). Tap on the Back Up Now option to backup your old iPhone including messages.