Posted on October 23, 2018 at 10:25 am
Simple steps to correctly backup and restore /etc/letsencrypt folder.
First you need to compress /etc/letsencrypt with tar:
tar czf /root/letsencrypt.tar.gz /etc/letsencrypt
To restore it on another server make sure to preserve symlinks!
Copy /root/letsencrypt.tar.gz on the new server.
Uncompress letsencrypt.tar.gz with gunzip:
Then uncompress the .tar archive using tar with -h parameter:
tar xfh letsencrypt.tar
* -h parameter is used to keep symlinks
Delete the content on /etc/letsencrypt/* folder:
rm -rf /etc/letsencrypt/*
Copy the content of “letsencrypt” folder to /etc/letsencrypt/ with cp:
cp * -RP /etc/letsencrypt/
* -P parameter is used to preserve symlinks
Now try to renew certificates to see if all is working fine:
certbot -q renew --post-hook "service nginx reload"
You may find interesting also:
- Connect as Root using WinSCP on Google Cloud Compute Engine
- Become Root on Google Cloud Compute Engine VMs
- Connect to Google Cloud Compute Engine VM via PuTTY SSH
- DigitalOcean Slow, My Experience
- Keep current version of config files when apt-get install on Debian
- How to Extract Links from a Web Page in Linux
- PHP Library for Google Authenticator (Two Factor Authentication 2FA)
- Should I reboot Debian server after apt-get upgrade?
- Unable to extract and upload PackageInfo.xml
- Stop Bad Bots from Crawling Your Website
- DEB.SURY.ORG Updated the Signing Key (March 2019)
- PHP Check if XML String is Valid
- PHP Securely Save Passwords in Your Database
- Redirect 404 Errors to Homepage with Nginx
- Nginx Rewrite Rule to Add Slash to The End of Any URL
- Lost connection during Debian apt-get upgrade