# Moving working certbot to a new server

**URL:** <https://community.letsencrypt.org/t/moving-working-certbot-to-a-new-server/190238>\
**Category:** Help\
**Created:** [December 29, 2022, 6:23pm UTC](https://community.letsencrypt.org/t/moving-working-certbot-to-a-new-server/190238 "2022-12-29T18:23:28Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![rfink](https://avatars.discourse-cdn.com/v4/letter/r/ad7895/32.png) [@rfink](https://community.letsencrypt.org/u/rfink)\
**Post date:** [December 29, 2022, 6:23pm UTC](https://community.letsencrypt.org/t/moving-working-certbot-to-a-new-server/190238/1 "2022-12-29T18:23:28Z")

</div>

The existing server (where certbot is installed and working) needs to be replaced. I can replace it with a new instance of the same local hostname, DNS name, and IP. However, I don't know exactly what files to copy and restore to the new server so that it will be able to renew our certs when the time comes. I see several in /etc/letsencrypt, but please let me know if others exist. I have about 30 days before I must renew our certs.

Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g. [crt.sh | example.com](https://crt.sh/?q=example.com)), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

My domain is: [search.usa.gov](http://search.usa.gov) and many SANs

I ran this command: Nothing yet

It produced this output: haven't run a command yet

My web server is (include version): apache 2.4

The operating system my web server runs on is (include version): ubuntu 18.04

My hosting provider, if applicable, is: AWS

I can login to a root shell on my machine (yes or no, or I don't know): yes

I'm using a control panel to manage my site (no, or provide the name and version of the control panel): no

The version of my client is (e.g. output of `certbot --version` or `certbot-auto --version` if you're using Certbot): 0.27.0

---

<div class="post-metadata">

**Author:** ![Osiris](https://avatars.discourse-cdn.com/v4/letter/o/839c29/32.png) [@Osiris](https://community.letsencrypt.org/u/Osiris)\
**Post date:** [December 29, 2022, 6:32pm UTC](https://community.letsencrypt.org/t/moving-working-certbot-to-a-new-server/190238/2 "2022-12-29T18:32:47Z")

</div>

Just migrating `/etc/letsencrypt/` entirely should be just fine. Make sure you use a method that preserves symbolic links.

---

<div class="post-metadata">

**Author:** ![rg305](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/rg305/32/91314_2.png) [@rg305](https://community.letsencrypt.org/u/rg305)\
**Post date:** [December 29, 2022, 6:59pm UTC](https://community.letsencrypt.org/t/moving-working-certbot-to-a-new-server/190238/3 "2022-12-29T18:59:10Z")

</div>

And also "copy" the cronjob that runs `certbot` [or create a new one] if one is not already there.

---

<div class="post-metadata">

**Author:** ![rfink](https://avatars.discourse-cdn.com/v4/letter/r/ad7895/32.png) [@rfink](https://community.letsencrypt.org/u/rfink)\
**Post date:** [December 29, 2022, 7:08pm UTC](https://community.letsencrypt.org/t/moving-working-certbot-to-a-new-server/190238/4 "2022-12-29T19:08:32Z")

</div>

Good to know, thank you Osiris!

---

<div class="post-metadata">

**Author:** ![rfink](https://avatars.discourse-cdn.com/v4/letter/r/ad7895/32.png) [@rfink](https://community.letsencrypt.org/u/rfink)\
**Post date:** [December 29, 2022, 7:12pm UTC](https://community.letsencrypt.org/t/moving-working-certbot-to-a-new-server/190238/5 "2022-12-29T19:12:13Z")

</div>

Good point rg305! When I tested installing certbot on a new server it did create a new cron job, but I didn't compare it to the old one. We do take advantage of that job to attempt auto-renew, but unfortunately we have so many SANs that one or more of them always gives an issue that needs to be resolved before renew can complete successfully.

I'll be sure to document and recreate the existing cron job.

---

<div class="post-metadata">

**Author:** ![Osiris](https://avatars.discourse-cdn.com/v4/letter/o/839c29/32.png) [@Osiris](https://community.letsencrypt.org/u/Osiris)\
**Post date:** [December 29, 2022, 7:43pm UTC](https://community.letsencrypt.org/t/moving-working-certbot-to-a-new-server/190238/6 "2022-12-29T19:43:04Z")

</div>

Depending on how Certbot was installed, the systemd timer or cronjob would have been installed with it.

---

<div class="post-metadata">

**Author:** ![rg305](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/rg305/32/91314_2.png) [@rg305](https://community.letsencrypt.org/u/rg305)\
**Post date:** [December 29, 2022, 11:50pm UTC](https://community.letsencrypt.org/t/moving-working-certbot-to-a-new-server/190238/7 "2022-12-29T23:50:15Z")

</div>

> [@rfink](#):
>
> We do take advantage of that job to attempt auto-renew, but unfortunately we have so many SANs that one or more of them always gives an issue that needs to be resolved before renew can complete successfully.

Have you considered splitting the single cert(s) into many [more] certs?

---

<div class="post-metadata">

**Author:** ![rfink](https://avatars.discourse-cdn.com/v4/letter/r/ad7895/32.png) [@rfink](https://community.letsencrypt.org/u/rfink)\
**Post date:** [December 30, 2022, 4:13pm UTC](https://community.letsencrypt.org/t/moving-working-certbot-to-a-new-server/190238/8 "2022-12-30T16:13:41Z")

</div>

Right now our architecture won't support that, but yes it is a thing we will have to do at some point, since parts of AWS only support 100 SANs on a cert.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/letsencrypt/original/3X/c/a/ca6c06ea1ea201324bba7048c6841ce60236468d.png) [@system](https://community.letsencrypt.org/u/system)\
**Post date:** [January 29, 2023, 4:14pm UTC](https://community.letsencrypt.org/t/moving-working-certbot-to-a-new-server/190238/9 "2023-01-29T16:14:08Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
