# How to regenerate renewal config file?

**URL:** <https://community.letsencrypt.org/t/how-to-regenerate-renewal-config-file/58628>\
**Category:** Help\
**Created:** [April 4, 2018, 7:56pm UTC](https://community.letsencrypt.org/t/how-to-regenerate-renewal-config-file/58628 "2018-04-04T19:56:58Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![mconigliaro](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/mconigliaro/32/87036_2.png) [@mconigliaro](https://community.letsencrypt.org/u/mconigliaro)\
**Post date:** [April 4, 2018, 7:56pm UTC](https://community.letsencrypt.org/t/how-to-regenerate-renewal-config-file/58628/1 "2018-04-04T19:56:59Z")

</div>

The documentation says it’s not recommended to manually modify the renewal configuration file, but what should we do if we want to make a change between renewals (e.g. forgot to add a post hook, etc.)? Is there a recommended way to regenerate the configuration file (without generating a whole new certificate) so it’s correct for the next renewal? I was hoping that rerunning my original certificate command with `--dry-run` would do it, but it doesn’t. From what I can tell, the renewal config file only gets written the first time the certificate is generated, and never gets updated by `certbot` again.

Related:

- [Changing --webroot\_path configuration before renewal?](https://community.letsencrypt.org/t/changing-webroot-path-configuration-before-renewal/29770)

---

<div class="post-metadata">

**Author:** ![jmorahan](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/jmorahan/32/1873_2.png) [@jmorahan](https://community.letsencrypt.org/u/jmorahan)\
**Post date:** [April 4, 2018, 8:52pm UTC](https://community.letsencrypt.org/t/how-to-regenerate-renewal-config-file/58628/2 "2018-04-04T20:52:33Z")

</div>

As far as I know, requesting a new / renewed certificate and manually editing the files are the only ways to make changes.

I remember reading that recommendation not to edit the file manually, but I can’t find it now. I think the reasoning behind it was just that the format isn’t documented. It’s not terribly hard to figure out, though. Make a backup before experimenting, of course. If there’s an option you want to use and you’re not sure what it should look like in the config file, you can use `--staging` (and `--cert-name`) to try it out; that _does_ write a renewal config file but it also writes a cert so you won’t want it to overwrite your real certs (hence `--cert-name` to save it under a different name).

---

<div class="post-metadata">

**Author:** ![mconigliaro](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/mconigliaro/32/87036_2.png) [@mconigliaro](https://community.letsencrypt.org/u/mconigliaro)\
**Post date:** [April 4, 2018, 8:59pm UTC](https://community.letsencrypt.org/t/how-to-regenerate-renewal-config-file/58628/3 "2018-04-04T20:59:51Z")

</div>

For the record, those warnings (several of them) are here: [https://certbot.eff.org/docs/using.html#modifying-the-renewal-configuration-file](https://certbot.eff.org/docs/using.html#modifying-the-renewal-configuration-file)

I was going to ignore these and just manage the file myself via config management, but that seemed trickier the more I looked at it. Does anyone else think we should have a command line option to rewrite these files for us? Should I put in a feature request somewhere?

---

<div class="post-metadata">

**Author:** ![ferrency](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/ferrency/32/32140_2.png) [@ferrency](https://community.letsencrypt.org/u/ferrency)\
**Post date:** [April 4, 2018, 9:01pm UTC](https://community.letsencrypt.org/t/how-to-regenerate-renewal-config-file/58628/4 "2018-04-04T21:01:15Z")

</div>

Regarding the final resolution of my related thread:

To handle a modified `--webroot_path`, we ended up modifying the renewal conf file in-place (via script, automatically as needed).

I’ll check out that warning, but I think in general, having an officially supported way to modify renewal configuration without reissuing a cert would be ideal.

---

<div class="post-metadata">

**Author:** ![jmorahan](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/jmorahan/32/1873_2.png) [@jmorahan](https://community.letsencrypt.org/u/jmorahan)\
**Post date:** [April 4, 2018, 9:10pm UTC](https://community.letsencrypt.org/t/how-to-regenerate-renewal-config-file/58628/5 "2018-04-04T21:10:23Z")

</div>

> [@mconigliaro](#):
>
> Does anyone else think we should have a command line option to rewrite these files for us? Should I put in a feature request somewhere?

That seems like a good idea to me. Certbot's issue tracker is [here](https://github.com/certbot/certbot/issues) if you want to put in a feature request.

---

<div class="post-metadata">

**Author:** ![schoen](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/schoen/32/79_2.png) [@schoen](https://community.letsencrypt.org/u/schoen)\
**Post date:** [April 4, 2018, 10:20pm UTC](https://community.letsencrypt.org/t/how-to-regenerate-renewal-config-file/58628/6 "2018-04-04T22:20:38Z")

</div>

The historic reason why this doesn’t exist in general may be in part that making an invalid change in the renewal configuration could cause automated renewals to start failing, but you conceivably wouldn’t notice this for a long time. For example, if you manually change your webroot by editing the renewal configuration but get it wrong, you can’t renew with `certbot renew` anymore, but you don’t necessarily know this because you haven’t had Certbot try to complete the renewal.

---

<div class="post-metadata">

**Author:** ![jmorahan](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/jmorahan/32/1873_2.png) [@jmorahan](https://community.letsencrypt.org/u/jmorahan)\
**Post date:** [April 4, 2018, 10:21pm UTC](https://community.letsencrypt.org/t/how-to-regenerate-renewal-config-file/58628/7 "2018-04-04T22:21:35Z")

</div>

Hmm. Okay, what if it ran a `--dry-run` before updating the file?

---

<div class="post-metadata">

**Author:** ![schoen](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/schoen/32/79_2.png) [@schoen](https://community.letsencrypt.org/u/schoen)\
**Post date:** [April 4, 2018, 10:22pm UTC](https://community.letsencrypt.org/t/how-to-regenerate-renewal-config-file/58628/8 "2018-04-04T22:22:28Z")

</div>

That might be helpful!

---

<div class="post-metadata">

**Author:** ![jmorahan](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/jmorahan/32/1873_2.png) [@jmorahan](https://community.letsencrypt.org/u/jmorahan)\
**Post date:** [April 4, 2018, 10:55pm UTC](https://community.letsencrypt.org/t/how-to-regenerate-renewal-config-file/58628/9 "2018-04-04T22:55:50Z")

</div>

> <https://github.com/certbot/certbot/issues/5828>

---

<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:** [May 4, 2018, 10:55pm UTC](https://community.letsencrypt.org/t/how-to-regenerate-renewal-config-file/58628/10 "2018-05-04T22:55:54Z")

</div>

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