How to auto-renew cert when it was initially created manually http

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 -d -d

I would like to run the following in a daily cron job:
certbot renew --pre-hook “systemctl stop nginx” --post-hook “systemctl start nginx”


When you are done with transferring to new vps and ready to use http validation (or webroot) to automate renewal process, just add -a (to override manual mode in your conf )with applicable arguments.

For example:

certbot renew -a webroot -w path-you-want

Document referred:

Thank you

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