Migrations between different hosting services can be a daunting task. To help you migrate your current deployments to Now, we have prepared this step-by-step guide.
In order to avoid any downtime at all, we will take a few extra steps from the typical now alias workflow.
The first phase involves setting up your project in our infrastructure and ensuring everything is running smoothly.
In the very first step, we need to 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.
Typically, adding a domain name to our system involves a verification step to ensure DNS settings are correct.
Since DNS updates tend to take a while to propagate, this process would probably result in some potential downtime of a few minutes while your nameserver changes reflect.
To avoid this situation, we can first register the domain name as external, by retaining your current DNS provider.
To register your domain
example.ai in our system, run:
Initially, the command will output something like this:
After you add this record via your DNS provider, you can re-run the initial command and it will succeed. You should get a message like this:
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 being provided to you when purchasing the SSL cert.
To add your SSL certificate to be used for your domain, use the following command:
Which will render something like this:
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:
Which will result in:
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
ANAME record pointing to
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
As DNS changes begin to propagate, your site should now be working!
Once the migration is completed, and everything is working perfectly, we need to do a few more steps to ensure everything will continue to work on correctly.
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:
Make sure to run that command for all your other domains and subdomains.
To get all the benefits of the Now workflow, we suggest using our DNS service zeit.world, optimized for both a great developer experience and fast lookup times.
The best way to transition to it while preserving 100% uptime is to manually initialize the same DNS records that your external DNS currently has.
example.ai we will run:
And for a subdomain we would run:
After that, simply update your domain's settings to point to any of our nameservers and the migration will be complete!