How to Move a Website to a New Domain
Before a single redirect goes live, every address on the old site needs a destination on the new one — mapped one for one, not swept to the home page.

In this article
Plan the mapping before you touch the server
Before you even configure the redirects, you must prepare a precise conversion from each current URL to its corresponding new address.
Google recommends this step as the very first one. Do NOT implement any redirects, or even start thinking about them, without having this one-to-one URL mapping worked out. Google Search Central warns of site moves that drive all old links to a generic new address; on these, "it appears that you haven't carefully coordinated the mapping between old and new URLs, and you aren't taking advantage of the benefits of maintaining those mappings."
So don't start building the cart before you've made the list of what you're loading.
Make the redirect permanent and one-to-one
Having established that old and new URLs are going to be one-to-one, make each and every one eliminate the old through a permanent redirect. Google Search Central's best practices specify a 301 redirect for every page and post. Implement the redirect on the server's HTTP level, not at the application or JavaScript level. This is what a permanent move needs.
301 redirects explain to both browsers and search engines that the content of the address they're trying to reach is permanently housed in a new place. A 302, on the other hand, signals that the location is just temporary. Google says you "should use a 301 if the content is moved permanently, a 302 if the change is only temporary."
Take "permanent" the other way, too, and make it a real gutsy, persistent level of permanent too, not just until the old domain expires. Google tells you to "keep the redirects for as long as possible, generally at least 1 year. A redirect should not expire (go back to a 200 OK) until the site element is also removed from the old site."
[TO VERIFY: What kind of fallout comes from removing a redirect too soon? Dropped links? Broken navigation? Send search back to the old address?]
Use Google’s migration tools where they apply
Google Search Central has its own page on it. They say to submit a URL Change of Address in Search Console. Google calls this "an important step when doing a site move, as it allows you to notify Google of a change in the URL of the site." So there. Use the tool when you're up to this.
Also with Search Console, don't forget to submit the new site's sitemap right away. This makes Search Console aware of every canonical URL you've redirected.
Keep the redirects alive long enough for search to settle
Again: keep them. Once you launch, don't turn them off.
They keep serving up the new destinations for anyone still arriving at the old locations, or who doesn't yet know they need to convert their references. If you leave them alone, or let them go to 404 errors, the search traffic will follow them down.
How long is too short? The general rule is one year. Search Console does tell you to get rid of them when you can. For most migrations, that's after the next year. However, Google says they should be there "for as long as possible" in general.
Verify with a staged test, not just a launch-day flip
Google's April 2008 blog post reviewing site migrations is still live, and it tells you to run a trial of the URL map. Use a staging site just before the full flip. It won't have the same forever effects as the real one, and Google can't guarantee that those effects exactly follow the trial either, but it gives you a way back if there's a problem.
One way Google recommends experimenting is at the subdomain level. Or try it just on one directory, they say. This is another place where the pre-calculated URL map is the only one you're allowed to have.
How long should this test take? How far out should you do it? Google doesn't state a number, just a rule to not do it on launch-day. Get it over in a separate staging site, they say, and deal with it in a separate Refresh button. They said — in 2008, but still it's what they said in that context — so again, that's what they said to do.
There. Stop. Finished.
More in Publishing