Discover Centmin Mod today
Register Now

Migrating wordpress sites on Linode

Discussion in 'Blogs & CMS usage' started by Mrbo, Jun 22, 2018.

  1. Mrbo

    Mrbo Member

    112
    7
    18
    Jun 17, 2018
    Ratings:
    +7
    Local Time:
    4:33 AM
    What steps should I take, or articles to read, to wordpress sites on Linode? They are on ubuntu 16.04 / 18.04 setup with serverpilot and every site is going through Cloudflare SSL atm if that matters?
     
  2. eva2000

    eva2000 Administrator Staff Member

    45,662
    10,361
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,080
    Local Time:
    7:33 AM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    Moving data from one server environment to another involves understanding both environments and knowing what data to move. For Centmin Mod the config file overview is outlined at Centmin Mod Configuration Files - CentminMod.com LEMP Nginx web stack for CentOS

    For moving site data there's 2 general guides where the principles & steps of backing up and moving data is the same just slightly different for
    1. Moving Centmin Mod site data to another Centmin Mod server
    2. Moving cPanel/WHM site data to Centmin Mod server
    Those guides move alot more than just the site(s) in question but config files etc. You can use your own best judgement as to the config files and whether you want to move them or just use the fresh server setup Centmin Mod config files as they get auto optimised for the server Centmin Mod initially installed on.

    These 2 guides don't specifically cover serverpilot environment though but the data migration process is usually the same, backup the data files + mysql data and then transfer to new server and restore files and mysql data.

    You can do this safely by not changing domain DNS and just do test migrations of data to a test new VPS keeping live site on serverpilot untouched and just practice migrations until you're comfortable with real move. So to start with know the environments and know how to backup data files and mysql databases via mysqldump and how to transfer that data i.e via rsync.
     
  3. Mrbo

    Mrbo Member

    112
    7
    18
    Jun 17, 2018
    Ratings:
    +7
    Local Time:
    4:33 AM
    Awesome, thanks!
     
  4. Mrbo

    Mrbo Member

    112
    7
    18
    Jun 17, 2018
    Ratings:
    +7
    Local Time:
    4:33 AM
    I went another route, since the guide was overwhelming with my current knowledge, and I wanted to hear if you have any concerns regarding it?

    *Installed wordpress with option 22
    *Backed up current wp website with " all in one wp migration"
    * Accessed the newly installed website without DNS with this linode workaround
    Previewing Websites Without DNS
    * Restored the back up
    * Changed cloudflare dns
     
  5. eva2000

    eva2000 Administrator Staff Member

    45,662
    10,361
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,080
    Local Time:
    7:33 AM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    should work though you won't be able to get letsencrypt ssl cert for it as DNS isn't in place and will need to change file directory/permissions to nginx user/group if the restore retains old user/group permissions
     
  6. Mrbo

    Mrbo Member

    112
    7
    18
    Jun 17, 2018
    Ratings:
    +7
    Local Time:
    4:33 AM
    How do you mean? Is there any workaround afterwards?
    ( the website is running over SSL now, but I guess theres something im not getting)

    Is there any tutorial to check if its needed and then changing it if needed?
     
  7. eva2000

    eva2000 Administrator Staff Member

    45,662
    10,361
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,080
    Local Time:
    7:33 AM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    How are you loading files ? via root user in sftp or via generated pure-ftpd virtual user ? See getting started guide step 2 if you're using root user via sftp
    Letsencrypt ssl certificates are domain validated so to issue a ssl certificate letsencrypt server checks if the domain name the ssl cert is for is pointing to the correct server IP which is configured via DNS A record pointing domain name to server IP. If letsencrypt can't verify the domain is pointing to the correct server IP via DNS record check, letsencrypt will fail to issue a ssl certificate.

    As to workarounds, you could at centmin.sh menu option 22 run time choose = YES to self-signed ssl cert and NO to letsencrypt so you have a domain.com.ssl.conf nginx vhost already made and wordpress has https set. But preview access to wordpress https site will report untrusted/insecure for browser and you just ignore that due to self-signed ssl cert.

    And then latter once DNS updated, follow the guide for existing non-HTTPS Nginx vhost sites migration to HTTPS as outlined at Migrating Existing Nginx Vhost From HTTP to HTTP/2 based HTTPS With Letsencrypt SSL Certificates just with step 6 instead of creating the domain.com.ssl.conf, you'll be editing your existing one created via self-signed ssl cert routine already.

    Note:
    • For wordpress auto installer, you actually to enable LETSENCRYPT_DETECT='y' then run centmin.sh menu option 22 which will detect letsencrypt support and display the additional letsencrypt prompts required to issue free letsencrypt ssl certificates for wordpress auto installer
     
  8. Mrbo

    Mrbo Member

    112
    7
    18
    Jun 17, 2018
    Ratings:
    +7
    Local Time:
    4:33 AM
    Through the wordpress admin panel. Just choosing the backup file.

    Whats the difference between the Cloudflare SSL and the SSL that gets generated through option 22?
    And whats the difference between choosing yes to letsencrypt through the option 22 or no, and then following the guide that you posted? ( trying to get the hang of how everything is working)
     
  9. eva2000

    eva2000 Administrator Staff Member

    45,662
    10,361
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,080
    Local Time:
    7:33 AM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    in that case php will give those files correct permissions for nginx user/group

    different ssl certificate providers but serve same purpose though you will need both cloudflare ssl served to visitors and letsencrypt ssl on nginx backend origin served to cloudflare when cloudflare set to full ssl (instead of flexible ssl)

    letsencrypt via centmin.sh menu option 22 only works if you have domain DNS pointing to server IP which you won't if you are just doing host file edit to preview domain so need to follow the guide to do letsencrypt ssl after you update DNS
     
  10. Mrbo

    Mrbo Member

    112
    7
    18
    Jun 17, 2018
    Ratings:
    +7
    Local Time:
    4:33 AM
    Great, thanks for all the info!

    So if I change the DNS in Linode to the new centmin server before creating the wordpress installation with option 22, will the letsencrypt ssl be created properly if i run option 22 and choose yes to letsencrypt? ( If so it might be worth the 5 min downtime if I do it around 3am for the different timezones atm )
     
  11. eva2000

    eva2000 Administrator Staff Member

    45,662
    10,361
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,080
    Local Time:
    7:33 AM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    yes it would that properly issue letsencrypt ssl cert - just set DNS A record TTL to very low value like 30-60 seconds if possible so updates faster. You can always switch DNS back to old server IP after you finish running centmin.sh menu option 22
     
  12. Mrbo

    Mrbo Member

    112
    7
    18
    Jun 17, 2018
    Ratings:
    +7
    Local Time:
    4:33 AM
    Awesome! That was an easy fix, thanks!