Backup and restore rpi4

My domain is: down atm
I ran this command: certbot
It produced this output:
My web server is (include version): Apache
The operating system my web server runs on is (include version): rasbian buster
My hosting provider, if applicable, is: home
I can login to a root shell on my machine (yes or no, or I don't know): yes
I'm using a control panel to manage my site (no, or provide the name and version of the control panel): no

I installed nextcloud on my raspberry Pi 4 (4gb), all up to date, and followed a guide to use letsencrypt using snap, it seemed to work well, using an external USB SSD.

Then I hit a problem, unrelated and borked the OS, despite my efforts I can no longer log in to this system.
However, I used an SD card to boot and started again, I now have the system up and running but not yet opened it up to the net (router port forwarding) running off the sd card.
I have access to the original SSD, so can copy files etc. from it.
Can someone tell me how to copy the certs from the non bootable SSD to the sd card and make them active?
I assume I install certbot, copy the /etc/letsencrypt/live/$domain folder from the SSD to the sd and run certbot?
I did search but it wasn't very clear.
Or should I forget trying to copy the existing certs and start again from scratch?
Thanks,
Rev

Not quite. The /live/ directory only contains symbolic links to the actual files in /archive/. Also you need the renewal configuration file in /renewal/, which has an account hash hardcoded from /accounts/.

In essence: I think it's most practical to just backup the whole /etc/letsencrypt/ directory, making sure to preserve ownership, permissions and symbolic links.

That sounds about right. So copy the whole /letsenctypt folder to the new sd card and install and run certbot.
Thanks for the help Osiris :slight_smile:

Yes, but note that if you're using cp that you're using the correct option(s), such as -a.

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