Hello,
If I want to move my domain which has a letsencrypt certificate to another server, what are the steps to do it?
Thanks
Hello,
If I want to move my domain which has a letsencrypt certificate to another server, what are the steps to do it?
Thanks
Hi @fernandoch
how did you install your certificate? Shared hoster, certbot, cpanel? What has your new server?
With certbot and new server will also have certbot.
In such a case, I would:
What files should I copy and where?
And will the new installation know how to update the files?
Why to create a new certificate? What is the goal here?
Hi @fernandoch,
You can copy the entire dir /etc/letsencrypt/ and restore it on your new server.
Old server (as root):
tar zpcvf backup_etc-letsencrypt_2018-Nov-20.tar.gz /etc/letsencrypt/
Now transfer the file to the new server.
New server (as root):
tar zxvf backup_etc-letsencrypt_2018-Nov-20.tar.gz -C /
And you have all the certificates, renewal confs, etc. on your new server.
certbot will use the information saved on renewal conf files /etc/letsencrypt/renewal/*
so if the paths to your webroot etc. are the same, you should have no issues, if the paths have changed then you should modify them on the renewal conf files for all your domains, but well all this depends on how you issued your certificates... (using certonly, webroot, apache plugin, nginx plugin, etc.)
Cheers,
sahsanu
A certificate has two or three files, you should find these under
/etc/letsencrypt/live
in the correct folder. So you have two options:
If you have exact the same configuration (directories to your website), (1) is possible. If you have a different configuration, a fresh installed certbot and a new command may be your option.
If you create a certificate the first time, certbot saves your settings and re-use these to renew. But that requires exact the same configuration. And you must transfer your cron job.
Where is the cron saved as it is not in my crontab…
How did you install certbot on the new server? If you installed it using your operating system’s package manager, it probably installed a cron job and/or a systemd timer along with the package, so you don’t need to add one manually. If you used certbot-auto then you can just create a simple cron job yourself, to run certbot-auto renew
twice a day at a random time. The certbot website gives this example:
0 0,12 * * * python -c 'import random; import time; time.sleep(random.random() * 3600)' && ./path/to/certbot-auto renew
I found it in /etc/cron.d
This is the line used
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin0 */12 * * * root test -x /usr/bin/certbot -a ! -d /run/systemd/system && perl -e 'sleep int(rand(3600))' && certbot -q renew
What creates that?
I may need to delete the certificate from old server and create a new one in new server... I think it will all be easier.
The package installer (eg apt / yum) creates that file or a similar one when you install certbot from a package. If you've already installed certbot on the new server then it should already be there.
Thanks. New server not installed yet. Planning everything.
I just did that… here’s what I did:
Revocation, by itself, doesn't prevent autorenewal. In fact, it may make autorenewal happen sooner!
If you don't want autorenewal on the old server, you should delete the certificate there with certbot delete
.
(However, if you were prompted to delete the certificate after revoking it, and you did so, then it won't autorenew.)
Yes, every time I’ve revoked a cert it asked me if I wanted to delete it … and I did.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.