A 301 redirect will let search engines know: “Hey, you know that piece of content that users enjoyed clicking on from Search Engine Results Page (SERP)? Well, it now lives over here, so take all that visibility you associated with this page, and transfer it over to this new URL.”
Now, when you attempt to visit the old URL, the server will send back the 301 – Permanently Moved status code, and then move you on to the new location.
This happens so quickly that you’re usually not aware of it, and will simply find yourself on the piece of content for which you’d searched. You might notice that the URL is different from the one you clicked on or typed in.
How long for website redirection to complete?
It’s a good idea to have a 301 redirect on the old domain. That should make the transition easier. It is good to retain the 301 redirect until no more visible traffic are coming from the old URLs.

Migrations are about the riskiest thing you can do from a SEO perspective, and many go wrong. Often the drop in rankings, can be caused by some unintended side effect: loss of robots.txt directives, some on page details changed when you edited the URLs, change in the link architecture on the site.