Thanks for that info and choosing the Apple Support Communities. It sounds like you want to restore your iCloud backup to your new iPhone and need to get a verification code for two-factor authentication. The good news is you can get this on another trusted device or trusted phone number, and here is more info:
Use the code displayed on your trusted device
If you have a trusted device running iOS 9 and later or OS X El Capitan and later, the verification code is displayed automatically on your trusted devices.
- Sign in with your Apple ID and password on a new device or browser.
- Look for a sign in notification on any of your trusted devices.
- Tap Allow to receive your verification code.
- Enter the verification code on your other device to complete sign in.
Get a text or phone call
If you don’t have a trusted device handy, you can have a verification code sent to your trusted phone number as a text message or phone call.
- Click Didn't get a verification code on the sign in screen.
- Choose to have the code sent to your trusted phone number.
- You'll get a text message or phone call from Apple with your verification code.
- Enter the code on your other device to complete sign in.
Get a code from Settings on your trusted device
If you can’t receive a verification code on your trusted devices automatically, you can get one from Settings, even if your device is offline.
From your iPhone, iPad, or iPod touch:
In iOS 10.3 or later:
- Go to Settings > [your name].
- Tap Password & Security > Get Verification Code.
In iOS 10.3 or later, if your device is offline:
- Go to Settings > [your name].
- Tap Password & Security.
- A message says "Account Details Unavailable." Tap Get Verification Code.
In iOS 10.2 or earlier:
- Go to Settings > iCloud.
- Tap your Apple ID username.
- If your device is offline, tap Get Verification Code. If your device is online, tap Password & Security > Get Verification Code.
From your Mac:
- Go to Apple Menu > System Preferences > iCloud.
- Click Account Details.
- If your device is offline, click Get Verification Code. If your device is online, click Security > Get Verification Code.
If you still can't sign in
If you can’t sign in, reset your password, or receive verification codes, you can request account recovery to regain access to your account. Account recovery might take a few days or longer, depending on the specific account information you can provide to verify your identity.
Get a verification code and sign in with two-factor authentication - Apple Support
Cheers!