Hello raya5,
We appreciate the information that you have provided. Since you are not receiving the two-factor authentication verification code from your previous iPhone, can you tell us if you have another trusted phone number or device? Here’s additional information on this: Get a verification code and sign in with two-factor authentication - Apple Support
"Whenever you sign in with your Apple ID on a new device or browser, you'll confirm your identity with your password plus a six-digit verification code. There are a few ways you can get a verification code. You can use the code displayed on your trusted device, get a text or phone call, or generate a code from your trusted device.
If you use iOS 11.3 or later on your iPhone, you might not need to enter a verification code. In some cases, your trusted phone number can be automatically verified in the background on your iPhone. It’s one less thing to do, and your account is still protected with two-factor authentication.
Use the code displayed on your trusted device
If you have a trusted device running iOS 9 or later, OS X El Capitan or later, iPadOS 13 or later, or watchOS 6 or 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.
*The notification might include a map of the approximate location of the sign-in attempt. This location is based on the new device's IP address and might reflect the network that it's connected to, rather than the exact physical location. If you know that you're the person trying to sign in but don't recognize the location, you can still tap Allow and view the verification code.
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.
- Select Didn't Get a 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. This text message might include an additional domain validation line. This line includes the @ symbol, the website name, and your code (for example: @icloud.com #123456 %apple.com).
- 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 Apple Watch
If your device is online:
- Go to Settings > [your name].
- Tap Sign-In & Security > Two Factor Authentication.
- Tap Get Verification Code.
If your device is offline:
- Go to Settings > [your name].
- Tap Sign-In & Security.
- A message says "Account Details Unavailable." Tap Get Verification Code.
From your Mac
- Go to Apple menu > System Settings, then click your name.
- Click Sign-In & Security > Two-Factor Authentication.
- Click Get a 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."
If you don’t have another trusted device or phone number, you can use account recovery to regain access to your Apple ID: How to use account recovery when you can’t reset your Apple ID password - Apple Support
"What is account recovery?
Account recovery is a process designed to get you back into your Apple ID account when you don’t have enough information to reset your password. For security reasons, it might take several days or longer before you can use your account again. We know this delay is inconvenient, but it's important so that we can keep your account and information safe.
Before you start the account recovery waiting period, try to reset your password.
- If you don't know your Apple ID, try your email address or phone number. In addition to your Apple ID, you can sign in and reset your password with other email addresses or phone numbers on file in your Apple ID account.
- Learn how to reset your Apple ID password on a trusted device or through the Apple Support app on a family member’s iPhone, iPad, or iPod touch. You can also visit an Apple Store and ask to use a device on site.
- If you set up an account recovery contact, they can also help you reset your password.
Use account recovery only as a last resort when you can’t sign in or reset your Apple ID password.
After you start account recovery
After you request account recovery, you get an email with a confirmation of your request and the date and time of when you can expect to regain access. This email arrives within 72 hours.
- If you submitted your account recovery request with iforgot.apple.com through your device's browser, you should avoid using that device during this period. Using that device might cancel account recovery.
- To avoid delays, turn off other devices that are signed in with your Apple ID until account recovery is complete.
When the wait period is over, Apple sends you a text or automated phone call with instructions to regain access to your account. Follow the instructions to regain access to your Apple ID."
These steps may help. Please let us know if you have further questions.
Take care.