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:
- PHP Generate Secure Random Passwords
- Google Cloud SQL and Public IP Address Security
- How to use Highlight.js to highlight code
- Nginx HTTP to HTTPS and non-www to www behind Google Load Balancer
- Quota 'IN_USE_ADDRESSES' exceeded. Limit: 8.0 in region
- Only allow Google Load Balancer traffic (Firewall Rules)
- Lost connection during Debian apt-get upgrade
- Bootstrap 3 Navbar with Logo Image
- PHP StrToTime() Returns Incorrect Timestamp '-1 MONTH'
- PHP Correctly Get Last 12 Months (Month per Month)
- Nginx Redirect From a Website to Another Website
- PHP Multi-cURL to Run Parallel cURL Requests (Example)
- Let's Encrypt on Nginx and SSL Grade A+
- Vertically align Facebook and Twitter share buttons
- Download Windows 10 ISO without Media Creation Tool
- DEB.SURY.ORG Updated the Signing Key (March 2019)