Just to be clear - do you mean, iCloud is not syncing all of your photos with the iCloud Photos Library? I am asking, because you used the word "backup".
iCloud Photos is not a backup of your photos, it is syncing your photos between iCloud and other devices using iCloud Photos. To get a backup of your photos, where you can recover accidentally deleted photos, you need an additional copy of your photos, that is not syncing any errors you make to the copy of the photos, so copy the photos to a computer. The big problem is, that your regular iCloud backup of your iPhone will no longer include your photos, once you start using iCloud Photos, you will have no backup at all, unless you copy the photos to a computer.
You can use the iCloud Photos Library to transfer your Photos and videos to the new iPhone and to keep the photos on both devices identical. There are two common reasons for the photos not uploading to iCloud Photos.
- Lack of iCloud Storage: Do you have still enough free storage in iCloud? Your iCloud Storage is also used for the backup of your iPhone, for your mail, your music, books, and other data, and your videos may need a lot of storage. Please check the free storage.
- Incompatible items in your Photos Library: You may have items in your Photos Library, saved from WhatsApp or other sources, that are not compatible with iCloud. Such items can block the upload to iCloud Photos. If you have items, that have not been taken with the iPhone camera in your library, save them to a computer or to iCloud Drive and remove them from Photos on the iPhone.