Recover with backup issue

Dear Team:

I have previously backed up my entire /etc/letsencrypt using this:
tar zcvf /tmp/letsencrypt_backup_$(date +'%Y-%m-%d_%H%M').tar.gz /etc/letsencrypt

After that I had to destroy my droplet in DigitalOcean, then I create a new one and after installing certbot with these commands:

sudo apt-get update
sudo apt-get install -y software-properties-common
sudo add-apt-repository ppa:certbot/certbot -y
sudo apt-get install -y certbot python-certbot-apache

I restore from my backup:
tar zxvf /home/subir/letsencrypt_backup_2019-11-09_2044.tar.gz -C /

Now I have multiple files here:

root@felipeDroplet02EsAhora:/etc/letsencrypt# ls -ltr
total 36
-rw-r--r-- 1 root root  121 Feb  9  2019 cli.ini
drwxr-xr-x 5 root root 4096 Nov  9 20:40 renewal-hooks
-rw-r--r-- 1 root root 1619 Nov  9 20:40 options-ssl-apache.conf
drwx------ 3 root root 4096 Nov  9 20:40 accounts
drwx------ 2 root root 4096 Nov  9 20:41 keys
drwxr-xr-x 2 root root 4096 Nov  9 20:41 csr
drwxr-xr-x 2 root root 4096 Nov  9 20:41 renewal
drwx------ 3 root root 4096 Nov  9 20:41 live
drwx------ 3 root root 4096 Nov  9 20:41 archive

But the problem is still I am not able to access www.esahora.cl with https, because is still giving me is not secure. It is the following error: “This site can’t be reached”

Could you please give me some help?

My domain is: esahora.cl

I ran this command:
sudo apt-get update
sudo apt-get install -y software-properties-common
sudo add-apt-repository ppa:certbot/certbot -y
sudo apt-get install -y certbot python-certbot-apache
tar zxvf /home/subir/letsencrypt_backup_2019-11-09_2044.tar.gz -C /
It produced this output: After I uncompressed the backup in my server, still my https is not working :frowning:

My web server is (include version):Apache/2.4.29 (Ubuntu)

The operating system my web server runs on is (include version): Ubuntu 18.04, Droplet

My hosting provider, if applicable, is:Digital Ocean

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

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you’re using Certbot):certbot 0.31.0

1 Like

When you backup those files, it only means your certificate (maybe) and configuration are backed up, doesn’t mean it would restore all environments or Apache configuration back to normal.

The /etc/letsencrypt only contains let’s Encrypt files, not your Apache configuration file or your certificate linked files…

What you should do:

  1. Make sure your Apache configuration contains your https site of your website, and it’s all configured correctly.
  2. Re-link the certificate files (from your let’s Encrypt archive) to your virtual host.
  3. Check all applicable ports are open.

Thank you

1 Like

Thank you stevenzhu for your reply.

  1. Make sure your Apache configuration contains your https site of your website, and it’s all configured correctly.

For Apache configuration I have reinstalled all over again, and MySQL as well.
I also reconfigure http to https in my website different tables in my data base.
I am using wordpress as my main site so I applied these scripts:

    UPDATE wp_options SET option_value = replace(option_value, 'http://www.esahora.cl/', 'https://www.esahora.cl/');
    /*WHERE option_name = 'home' OR option_name = 'siteurl';*/
    UPDATE wp_posts SET guid = replace(guid, 'http://www.esahora.cl/','https://www.esahora.cl/');
    UPDATE wp_posts SET post_content = replace(post_content, 'http://www.esahora.cl/', 'https://www.esahora.cl/');
    UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.esahora.cl/','https://www.esahora.cl/');
  1. Re-link the certificate files (from your let’s Encrypt archive) to your virtual host.
    About this I am not sure how to do this, Do I need to execute this command again?
    sudo certbot --apache

  2. Check all applicable ports are open.
    Before creating the new droplet and my old https was working I don’t remember to have opened an special port, I think point number 2 (relink certificate) is missing for me.

Please your help.