Moving Lots of Certificates to New Linux Server

I have a web server with 100+ websites running on it each with an LE certificate. I am going to be moving all the websites over to a newer server that's running CentOS Alma Linux 8 (the old server is running CentOS 7). The file structure will be exactly the same for all websites, and the domains will remain the same. The new server will have new IP numbers. To set up the certs for each website on the current server, I used this certbot command:

certbot certonly --webroot -w /home/web/site_dir -d

All of the LE files are located in /etc/letsencrypt. If I copy this folder and all its files to the same location on the new server, will the certificates still work after I redirect the domains to the new server? Or will I have to generate new certificates for every website on the new server?

My domain is: (Multiple)
My web server is: CentOS Alma Linux 8
The operating system my web server runs on is: Apache 2.4.5
I can login to a root shell on my machine: Yes
I'm using a control panel to manage my site: No

Yes, but you'll need to make sure you copy the files over with preserving symbolic links. Otherwise everything gets broken with Certbot.

But technically, a certificate doesn't mind if it's on server A, server B or both.


That's great! I will be using rsync to move the files from old to new server. It looks like I'll need to use the -l option (or --links) to do this. The manual states that this option will "copy symlinks as symlinks." Does that sound correct? These are the options I'll use:

rsync -arzP ...

The manual says the -a option includes the --links option, so I believe that's all I'll need to do to preserve the symlinks.

1 Like

I think that's correct indeed.


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