Backing up the data on iPhone:
It is always better to backup your data before you transfer content from your iPhone. Read on to know how it can be done:
Open the Settings > then in the list tap on iCloud.
Now, type in your Apple ID > then you would be asked to type in the Apple password for log in.
Then scroll down the list > then tap on Storage & Backup.
Now, tap on Back Up Now.
ONE THING that you should do before backing up the data on your iPhone or iPad is that you would have to disable the iCloud Photo Library. For this:
Go to Settings
Then tap on Photos
Now, you can transfer data from iPhone to another phone via iCloud. For this, you would have to sync your iOS device with iCloud.
On your iPhone, go to Settings > then select iCloud.
Now, turn on Contacts > then turn on Calendars.
Choose Photos > then turn on iCloud Photo Library.