I am in the process of migrating my site from one VPS to another one. Since DNS is pointing to the old VPS I have to create it manually. (I manually set new server in hosts file for testing purposes.) Then I will switch DNS to the new server. However since the cert was originally created manually I would like to renew it automatically. What do I need to do/change to do this simply?
I’m using nginx 1.14 and ran this to create the cert initially:
certbot certonly --manual --preferred-challenges http --force-renewal --agree-tos --no-eff-email --manual-public-ip-logging-ok -m admin@example.com -d example.com -d www.example.com
I would like to run the following in a daily cron job:
certbot renew --pre-hook “systemctl stop nginx” --post-hook “systemctl start nginx”