Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section General Discussion
  • Search

How to move a let's encrypt website to another server ? Topic is solved

General questions about VestaCP
Post Reply
  • Print view
Advanced search
9 posts • Page 1 of 1
Spheerys
Posts: 225
Joined: Tue Dec 29, 2015 12:36 pm

Os: Debian 7x
Web: apache + nginx
How to move a let's encrypt website to another server ?
  • Quote

Post by Spheerys » Sat Dec 22, 2018 3:03 pm

Hi :)

I want to move several websites from a vestacp server (nginx+apache2) to another (nginx+php-fm), but without use the vestacp backup script.
I have built a script to move database, files, etc... but I'm blocked with the LE certificat : how to copy and setting up the let's encrypt certs from old server to new one, to avoid disruption during DNS change ?
Top

Spheerys
Posts: 225
Joined: Tue Dec 29, 2015 12:36 pm

Os: Debian 7x
Web: apache + nginx
Re: How to move a let's encrypt website to another server ?
  • Quote

Post by Spheerys » Sat Dec 22, 2018 3:17 pm

I have found https://serverfault.com/questions/83800 ... ver-to-ano but I don't know how to adapt it to VestaCP
Top

cottager
Posts: 19
Joined: Mon Feb 06, 2017 8:10 pm

Re: How to move a let's encrypt website to another server ?
  • Quote

Post by cottager » Thu Dec 27, 2018 2:26 am

I used the vesta cli and it moves the let's encrypt cert just fine. I can't imagine a reason you'd not want to use it. It works quickly and simply.
Top

Spheerys
Posts: 225
Joined: Tue Dec 29, 2015 12:36 pm

Os: Debian 7x
Web: apache + nginx
Re: How to move a let's encrypt website to another server ?
  • Quote

Post by Spheerys » Sat Dec 29, 2018 4:51 pm

I can't use v-backup because several websites are managed by the same user on old server, and they will be moved to their own user on the new server.
Furthermore, some websites where "hacked" on the past, and I want to moved them by hand, with a very clean install.

That are the main reason I want to move them by my own way and why I need your help with the SSL cert :)
Last edited by Spheerys on Wed Jan 09, 2019 9:03 pm, edited 1 time in total.
Top

plutocrat
Posts: 232
Joined: Fri Jan 27, 2017 9:16 am

Os: Ubuntu 17x
Web: apache + nginx
Re: How to move a let's encrypt website to another server ?
  • Quote

Post by plutocrat » Tue Jan 08, 2019 4:00 am

One option: You can set up the website on the new server, before switching the DNS over. From the Admin > Web section, edit the site on the new server, and activate SSL. You may manually copy and paste the text of the certs from the current server into the new server. There are three boxes, just duplicate them from one server to the other.

That will allow you to get up and running. Once you've switched the DNS record over to the new server, remember to turn on Letsencrypt for the website, so that the certs will get renewed.
Top

Spheerys
Posts: 225
Joined: Tue Dec 29, 2015 12:36 pm

Os: Debian 7x
Web: apache + nginx
Re: How to move a let's encrypt website to another server ?
  • Quote

Post by Spheerys » Wed Jan 09, 2019 8:34 pm

Yes ! yes !
Thanks a lot plutocat, you saved - not my life - but a lot of headache !!!

I'm now looking the way to do this by CLI.
With your tip, I realized I could copied from the old server the files /home/USER/conf/ssl.DOMAIN.TLD.{ca,crt,key,pem} to the new server.
I also have to get back the files /home/USER/conf/DOMAIN.TLD.{apache2,nginx}.ssl.conf

But my last problem is : how to activate by CLI the SSL for this domain with using the copied certs ?

Maybe I have to change some stuff inside vestacp database, but it's not a big deal if you can help me to find what exactly :)
Top

plutocrat
Posts: 232
Joined: Fri Jan 27, 2017 9:16 am

Os: Ubuntu 17x
Web: apache + nginx
Re: How to move a let's encrypt website to another server ?
  • Quote

Post by plutocrat » Thu Jan 10, 2019 1:36 am

Maybe v-add-web-domain-ssl ?
# info: adding ssl for domain
# options: USER DOMAIN SSL_DIR [SSL_HOME] [RESTART]
#
# The function turns on SSL support for a domain. Parameter ssl_dir is a path
# to directory where 2 or 3 ssl files can be found. Certificate file
# domain.tld.crt and its key domain.tld.key are mandatory. Certificate
# authority domain.tld.ca file is optional. If home directory parameter
# (ssl_home) is not set, https domain uses public_shtml as separate
# documentroot directory.

I don't know if this will work. I don't have a domain to try it on, but if you look in /var/log/vesta/system.log you'll see examples of how it is used.

v-add-web-domain-ssl 'admin' 'www.domain.com' '/cert/dir' 'same' 'same' 'same' 'same'
Top

Spheerys
Posts: 225
Joined: Tue Dec 29, 2015 12:36 pm

Os: Debian 7x
Web: apache + nginx
Re: How to move a let's encrypt website to another server ?
  • Quote

Post by Spheerys » Thu Jan 10, 2019 8:46 am

Thanks again, it's look nearly good !

I could add the certs with this command :

Code: Select all

v-add-web-domain-ssl USER domain.tld /home/USER/conf/web /home/USER/web/domaine.tld/public_html
The point was I had to make symlink from /home/USER/conf/web/ssl.DOMAIN.TLD.{crt,ca,key} to /home/USER/conf/web/DOMAIN.TLD.{crt,ca,key} because v-add-web-domain-ssl looks for /home/USER/conf/web/DOMAIN.TLD.{crt,ca,key} (without the prefix ssl.) I don't know why...

So it's not very clean, but it's working...
Top

cottager
Posts: 19
Joined: Mon Feb 06, 2017 8:10 pm

Re: How to move a let's encrypt website to another server ?
  • Quote

Post by cottager » Tue Jan 15, 2019 1:41 am

I just first move the domain I want to split from a pack to a new user on the original server. Then I back it up, and then restore. You'll have to do a couple of things around that, like change database names in any configs to reflect the new database name that is based on the user.
Top


Post Reply
  • Print view

9 posts • Page 1 of 1

Return to “General Discussion”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password