Moving hosting and transferring the domain registration are two separate operations that people bundle together because they happen at the same time. Doing both at once means two things can go wrong while you are trying to diagnose one.
This article is about the sequencing. The transfer itself, codes, timing, what it costs, is covered in How to Transfer Your Domain to AHosting.
They are genuinely independent
Hosting is where your site is served from. Registration is who holds the name.
You can host with one company and register with another indefinitely, and many people should, keeping the domain at a registrar you chose means changing hosts later is a DNS edit instead of a negotiation.
So "transfer my domain along with my hosting" is a choice in place of a requirement, and it is worth making deliberately.
Move the hosting first
The order that keeps each step diagnosable.
Set the site up on the new host, test it, point DNS at it, and confirm everything works: site, mail, forms. Leave the registration where it is throughout.
If something breaks, the cause is the hosting move, because nothing else changed. That is worth a great deal at the moment something breaks.
Then transfer the registration, if you want to
Once the site has been stable for a week or two, the transfer is a separate, low-risk operation, and it does not touch the website at all, because nameservers carry across.
What it does affect is the settings around the domain: the lock comes off and may not go back on, auto-renewal is frequently off by default at the new registrar, and privacy protection may not carry. What to Check After Transferring a Domain goes over the list.
What breaks when you do both at once
Three failures, each of which is unambiguous alone and confusing together.
Nameservers reset. Some registrars apply their own defaults on transfer, which points the domain away from the host you just moved to.
Mail stops. If DNS moved with the transfer, MX records may not have come across, and that failure is silent from your side.
DNSSEC breaks the domain entirely if it was enabled and the keys no longer match the DS record. Understanding DNSSEC goes into disabling it before either operation.
Any of those alone points at its cause. All three at once, on the same afternoon, is a long evening.
Do not let the domain lapse in between
A transfer cannot start if the domain is close to expiry at some registrars, and a domain that expires mid-move is a far worse problem than a delayed transfer.
Renew first if the expiry is near. A transfer normally adds a year, and paying for one extra year is cheaper than a redemption fee. What Happens When a Domain Expires goes into what that costs.
Keep the old hosting for a fortnight
Whatever you decide about the registration.
Mail keeps arriving at the old server while DNS caches expire, and problems from a migration surface days later. Cancelling on the day you switch is the one irreversible step in this whole sequence. See What to Do Before You Cancel or Move Hosting.
A workable order
Lower the DNS TTL days ahead. Build and test on the new host. Point DNS. Confirm site and mail for a week. Renew the domain if expiry is near. Then transfer the registration. Then re-check the lock, auto-renewal and contacts.
Slower than doing it all in an afternoon, and every step tells you whether it worked before the next one starts.
Check where each part currently lives
The two are independent and people frequently do not know which company holds which, which is the first thing to establish.
whois example.com | grep -iE 'registrar:|expir' dig example.com NS +short dig example.com A +short curl -sI https://example.com/ | head -1
The registrar holds the registration. The nameservers decide where the domain points. The address is where the site is served. All three can be at different companies.
Reading them before starting prevents the common mistake of transferring the registration when the intention was to move the hosting, which achieves nothing visible and takes a week.
Lower the record lifetime before the move
The value attached to the records determines how long the change takes to reach everybody, and it has to be reduced in advance.
dig example.com A | awk '/^example/ {print "TTL:", $2, "saniye"}'
Reducing it is itself subject to the old value, so a record set to a day takes a day for the reduction to take effect. That is why it happens days ahead rather than on the morning of the move.
Raise it again after the move has settled. A permanently low value means every visitor's resolver asks more often than it needs to, which adds a small delay to every first visit.
Watch both servers during the changeover
For a period, some visitors reach the old server and some the new, and both answer.
tail -f ~/logs/example.com | grep -vE ' 30[12] '
awk '{print $7}' ~/logs/example.com | sort | uniq -c | sort -rn | head
Anything still arriving at the old server after a few days is a system using a fixed address rather than the domain. Each one stops working when the old account is cancelled.
That log is the only list of them that exists, and it is available only while the old hosting is still running, which is the argument for the overlap.