Not renewing after changing server

I changed my server from Fedora to Debian and backed /etc/letsencrypt directory. On the new server, I have restored that directory and installed a new let’s encrypt client from github.

Now this happens when I try to renew the certificate:

$ sudo ./letsencrypt-auto certonly --renew-by-default --webroot -w /var/www/html -d dns.domain.net
Checking for new version...
Requesting root privileges to run letsencrypt...
   /root/.local/share/letsencrypt/bin/letsencrypt --no-self-upgrade certonly --renew-by-default --webroot -w /var/www/html -d dns.domain.net
An unexpected error occurred:
OSError: [Errno 22] Invalid argument: '/etc/letsencrypt/live/dns.domain.net/cert.pem'
Please see the logfiles in /var/log/letsencrypt for more details.

Document root path has also changed so I tried changing it in /etc/letsencrypt/renew.

Please let me know if you need the log files.

1 Like

Hello @Swift-R,

What is the content of dir /etc/letsencrypt/live/dns.domain.net/?

ls -l /etc/letsencrypt/live/dns.domain.net/

Just because that are symlinks and maybe you didn't backup them properly.

Log file /var/log/letsencrypt/letsencrypt.log could give more info regarding your problem.

As far as I know those files are not taked into account if created with letsencrypt client version prior to 0.4.0. I mean, letsencrypt client ignores them if they are not created using last version that adds the renew feature.

Cheers,
sahsanu

Are they supposed to be symlinks? Because they’re not…

Yest, they should be symlinks pointing to last issued files in …/…/archive/dns.domain.net/{certx.pem,chainx.pem,privkeyx.pem,fullchainx.pem} where x is a number from 1 to 5.

2 Likes