Certbot package: switching from old package to snap on 20.04

I have a server that was running Ubuntu 18.04 with certbot installed from http://ppa.launchpad.net/certbot/certbot/ubuntu, providing certs for Apache. I've now upgraded the server to 20.04, but there is no version of certbot in the ppa repo for focal. For now I've updated to the disco version, but I gather that what I should do is to replace the ppa version with the snap. This is a live server, so I don't want to screw up this process.

My question is: If I uninstall the old certbot package and then install the new snap version, will it pick up the old configuration and just keep working, or will I have to start again and reconfigure certbot? (If the latter, of course, I need to schedule some downtime, which I'd rather not do if I don't have to.)

All help appreciated, Martin


Solution 1:

This worked just fine:

sudo apt remove certbot # to get rid of the old version. Config is retained undamaged.
sudo snap install --classic certbot # to install the now-preferred snap version
sudo certbot renew --dry-run # to check it was all working

Solution 2:

TL;DR: You should have no trouble switching to the snap version of certbot with minimal downtime.

I just installed the snap version of certbot, and I was previously using the ppa version of certbot. Although I did a fresh install of Ubuntu 20.04 due to various reasons, I backed everything up. I can say that the virtual host configuration files are identical for the snap version and ppa version. In terms of what Apache sees, there is no difference between the snap version and ppa version. Certbot still has the configuration files and certificates installed in /etc/letsencrypt/.

For example, at the end of my virtual host file, it provides:

Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem

You should see something very similar.