If you need to reset your iPhone to factory settings to resolve an issue, you can back it up to iCloud first and then restore it to keep your data.
You can upload photos to iCloud from your iPhone, iPad, PC, or Mac computer and easily sync photos across all of your devices.
Unboxing a new iPhone shouldn't make you anxious about whether your information will safely transfer to the new phone. These are the ways to do it easily and safely.