When migrating servers it’s best to leave a few months overlap on your old hosting contract. It’s a pain to pay double for a while but it’s critical to preventing downtime.
The first thing to do is get all your files moved over to the new server and test to make sure everything is working the same. Once you are satisfied that your new server is operating properly you can do a “full test run” with the DNS server configurations.
On your old hosting remove the DNS A Records for your old hosting server. It will typically be in there by default. Add a new custom DNS A record pointing to your new server.
This effectively redirects all traffic from your old hosting to the copy on the new hosting. Sometimes it takes as much as 48 hours for these changes to go into effect but in my experience, 15 minutes is more reasonable. Now all the traffic is headed to your new server and since you tested ahead of time (right??) everything is working as it should be.
Now you can migrate your domain names over to the new hosting provider without fear of 48 hours of downtime when your site and apps will be unreachable.