If you're moving from one domain to another domain, you want to make sure that it doesn't affect your positions in the Google rankings. For example, if you're moving from site1.com to site2.com.
The best way to do this is by using Google's Change of Address Tool which will help migrate your Google Search results from your old site to your new site.
Prior to using the Change of address tool, you'll want to make sure that you have set up 301 redirects correctly from your old homepage to your new homepage and from any canonical pages on your old site.
Google also have a couple of useful publications to help with your site move:
When your 301 redirects are setup correctly then its time to start the migration. You do this through Google search console.
You must be a verified owner of both the old and new properties in Search Console and you must use the same Google account to manage both sites. Also, bear in mind that the Change of Address tool can be used only on domain-level properties not on directories, eg. site1.com/products.
Another thing to consider here is that the tool moves all protocols of your source property. So if you specify http://site1.com, it also moves https://site2.com
When you're running the tool, it will make a few pre-move checks before telling Google about the move. If you fail any critical pre-move checks, you must fix the issue before you can continue. If you fail non-critical pre-move checks, you will see a warning with recommendations, but your request can continue.
If critical pre-checks pass, all sites being migrated from or to will display a notification in Search Console that the move is in progress. You will see these notifications for 180 days.
You can monitor the progress of the migration in search console.
After 180 days you can stop the redirects if you no longer see any traffic to the old site from Google. Remove your old pages, but continue to pay for the old domain for at least a year to prevent others from buying and using your abandoned domain for malicious purposes.
After the 180 day period, Google does not recognize any relationship between the old and new sites, and treats the old site as an unrelated site, if still present and crawlable.