In the very first step, we need deploy the project to now. For most apps, all it takes is to run now in your project's directory. Please check out our Getting Started section in our documentation center for more details.
It is important to make sure the deployment is working before sending live production traffic to it. Take some time to ensure the deployment is working correctly.
Now we are almost ready to update the DNS records to route traffic to your new now deployment. However, since all now deployments are served only over HTTPS, we need to provision an SSL certificate before we can proceed with the migration.
When you run now alias for a new project, SSL certificates are automatically provisioned and configured for you.
When migrating from an existing domain, however, it's not possible for us to provide the necessary validations, unless you decide to incur in a small amount of downtime.
You may use your old SSL certificates, buy a new one, or if your hosting provider supports it, you can use Let's Encrypt to issue you a free SSL certificate for your site.
To add the certificate, you will need three files: the key (example.ai.key below), certificate (example.ai.crt) and chain file (ssl_provider.crt). These are be provided to you when purchasing the SSL cert.
To add your SSL certificate to be used for your domain, use the following command:
now certs --key example.ai.key --crt example.ai.crt --ca ssl_provider.crt example.ai
Which will render something like this:
> Success! Certificate entry example.ai (vDKECujW1pNt8O2HbWXp) created [598ms]
For the incoming traffic for your domain to be routed to your new deployment, we need to add an alias for your domain to the deployment:
now alias my-deployment-eyhxcwtevc.now.sh example.ai
Which will result in:
> example.ai is a custom domain.
> Verifying the DNS settings for example.ai (see https://zeit.world for help)
> Verification OK!
> Success! Alias created (20eTbYba9wFNXfPODBxfMKVI):
https://example.ai now points to https://my-deployment-eyhxcwtevc.now.sh
(erwXnGEkDxAJQfCKTE3HFp3A) [copied to clipboard]
So far none of our changes have affected traffic to your site. Now we may finally flip the switch and point the DNS records to your recent now deployment.
For the apex domain (e.g.: example.ai, the domain name without www) you need to add an ALIAS or ANAME record pointing to alias.zeit.co.
If your DNS of choice doesn't support those record types, you might temporarily resolve alias.zeit.co and use one of the returned IP addresses. Please note that those might stop working after a while, so don't rely on them as a long-term solution. After you transition, make sure to move your DNS to zeit.world as outlined in the last few steps.
If your desired name is a subdomain instead, you need to add a CNAME record pointing to alias.zeit.co.
As DNS changes begin to propagate, your site should now be working!
If you performed the zero downtime migration from your existing host to now, you must have added an external SSL certificate. With the external cert, however, you do not have the benefit of automatic renewals.
To issue a free certificate that we manage and auto-renew, just run:
now cert renew example.ai
Make sure to run that command for all your other domains and subdomains.