Question

Transfer Wordpress Multisite from cpanel hosting to DO droplet.

Posted February 6, 2020 181 views
WordPress

Hi,
I have a website (wordpress multisite) running on cpanel which i would like to move to digitalocean droplet.
Ive tried it before but when all the db and files have been moved, i was not able to access all the multisites and also response time was way too much!

i want to know what would be the best way to host the multisite?
would it be LAMP? or ubuntu? or what would be the best way to handle it?

i was unable to find any recent and relevant information on the internet hence posting it here.
Thanks.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
6 answers

P.S
i also have forge.laravel subscription.. i tried setting up droplet using forge as well.. same issue..
i read somewhere about lamp installation instead of ubuntu install… so not sure what would work best

Hello, @awaix

You can either create a LEMP droplet and then migrate your WordPress multisite over or use our WordPress 1-click installer - https://marketplace.digitalocean.com/apps/wordpress

The installer will deploy a LAMP server with everything needed for hosting a WordPress site. You can then copy your files over and configure the rest of the setup after the migration.

You’ve mentioned that in the past you were not able to access all multisites. Can you please let me know if you’re using the sub-directories option for multisite?

As for the response times, I will recommend you to monitor the droplet’s performance once you’ve migrated your site in order to see if the resources are enough (in case you’ve started with a small droplet). There might a memory exhaustion coming from a plugin or something else can be consuming the droplet’s resources so you will need to monitor the droplet’s performance while working on your site to see what’s going on.

You can always upgrade the droplet’s resources so this should not be an issue.

As for the Laravel Forge issue, when you say that you’ve experienced the same issues, do you mean that the response times were big?

I will recommend you to go with a LEMP droplet for the Laravel Forge installation.

You can follow this tutorial for installation Laravel: https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-laravel-with-lemp-on-ubuntu-18-04

Hope this helps!

Regards,
Alex

by Erika Heidi
Laravel is an open source PHP framework that provides a set of tools and resources to build modern PHP applications. In this guide, you'll install and configure a new Laravel application on an Ubuntu 18.04 server, using Composer to download and manage the framework dependencies. When you're finished, you'll have a functional Laravel demo application pulling content from a MySQL database.
  • Thank you for replying back… when i mentioned laravel i meant forge service by laravel which also allow droplet creation with wordpress install.. but that didnt work out for me.

    Im more interested in knowing what setup and best way to move my site from cpanel hosting to DO.
    is there any recent guides available for this? i see many guides available but none for the multisite setup… and no im not using subdirectory for multisites.

    hope to hear from you soon.
    Thanks.
    Cheers.

    • Hello, @awaix

      If you’re keen on using cPanel you can deploy a cPanel/WHM droplet with 1 click from our marketplace: https://marketplace.digitalocean.com/apps/cpanel-whm

      Then you can use the cPanel Transfer tool in order to migrate all of your accounts from your current cPanel/WHM server. Keep in mind that you need to have the root password for your current cPanel server in order to use the Transfer tool.

      Other than that, your other options are to deploy a CentOs or Ubuntu server with LAMP or LEMP stack and then migrate your sites over. It’s totally up to you, but the easiest way will be to use the cPanel transfer tool as it will carry the migration process for you.

      Hope this helps!

      Regards,
      Alex

      • Hi,
        i think im not able to make myself clear… im currently on cpanel BUT i do not want cpanel… I need something which is best for big wordpress multisite website.
        im not sure if i should go for LAMP or LEMP… so i was hoping if you can guide me on what distribution would work best? and if there is any step by step instructions on it?

        • Hello, @awaix

          The distribution is up to, whatever you choose should be fine when it comes to host a WordPress multisite. You’re currently using CentOs since you’re using cPanel and if you’re keen on using it you can spin a CentOs droplet. Your other option will be to use Ubuntu as it’s pretty easy to configure everything you need to host a WordPress site.

          You can check these two tutorials on how to install LEMP and LAMP stack on Ubuntu 18.04

          https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-ubuntu-18-04

          https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-ubuntu-18-04

          Our marketplace 1 click install for WordPress is also using Ubuntu 18.04 and you can check it our here:

          https://cloud.digitalocean.com/marketplace/5ba19759c472e4189b34e066?i=106c34

          In my previous experience with Nginx, it’s all about how you optimize your configuration. If you keep the default configuration then the performance wont differ much from Apache based droplet. If you’re going to use a smaller droplet then perhaps Apache is the better solution, because Nginx slightly higher RAM use than Apache (likely due to the separate process required for fpm). However you can always test both configurations and compare the performance in order to make the decision which is suitable with your needs.

          Hope this helps!

          Regards,
          Alex

          by Mark Drake
          A "LAMP" stack is a group of open source software that is typically installed together to enable a server to host dynamic websites and web apps. This stack typically consists of the Linux operating system, the Apache web server, a MySQL database, and PHP, a dynamic content processor. This tutorial serves as a guide for installing these components on an Ubuntu 18.04 server.
          • Hi,
            i created a LEMP droplet and moved my website successfully… now the main website frontend is working

            BUT

            none of the internal pages or any multisite is working.. im getting 404 on all the urls.. my permalinks are not working as its not accepting .htaccess file from its directory…
            ive been searching for the solution for more than 6 hours now but cant seem to find the solution to this issue…

            i can access main website frontend as well as its backend but none of the other pages, posts or multisites are working.. all giving 404 error…

            ive tried resetting the permalink structure but nothing..
            any pointers? its an urgent matter as our main website has been messed up now.

fixed the 404 for a while.. was able to do it by changing config in nginx file but now website keeps loading for few minutes and then sometimes it works and sometimes 404 error again.. now even for the main website as well as for the main website backend..
now i can barely access the wp-admin for the main website… ive checked the graphs on the digitalocean panel and there is no surge of resources…

i have no clue what is causing this now… any help??

while the website is in loading state if i run sudo systemctl restart nginx.service it loads the next request and shows the page fine.. but then again same for next requests..

Ubuntu LEMP on 18.04
Size
2 vCPUs
4GB / 80GB Disk

Hello, @awaix

Thanks for getting back to me.

As you’re now with Nginx the .htaccess files will not work and you’ll need to sort out the rewrite for the internal pages directly from the Nginx config file for the domain name in question.

Can you please share your current nginx config file so I can check it for you? You need to make sure you have the following line in the nginx config:

try_files $uri $uri/ /index.php?$args; 

or this one:

try_files $uri $uri/ /index.php$is_args$args;

I usually prefer the second as it’s considered more precise. This should sort the issue with the permalinks for you.

Let me know how it goes.

Regards,
Alex

# You may add here your
# server {
#   ...
# }
# statements for each of your virtual hosts to this file

##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart
# http://wiki.nginx.org/Configuration
#
# Generally, you will want to move this file somewhere, and start with a clean
# file but keep this around for reference. Or just disable in sites-enabled.
#
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
##

server {
    listen 80 default_server;
    listen [::]:80 default_server ipv6only=on;

    root /var/www/html;
    index index.php index.html index.htm;

    # Make site accessible from http://localhost/
    server_name localhost;

    location / {
        # First attempt to serve request as file, then
        # as directory, then fall back to displaying a 404.
        # try_files $uri $uri/ =404;
        try_files $uri $uri/ /index.php?$args;
        # Uncomment to enable naxsi on this location
        # include /etc/nginx/naxsi.rules
    }

    error_page 404 /404.html;
    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
        root /usr/share/nginx/html;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php7.2-fpm.sock;
    }

    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    #
    #location ~ /\.ht {
    #   deny all;
    #}
}


# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
#   listen 8000;
#   listen somename:8080;
#   server_name somename alias another.alias;
#   root html;
#   index index.html index.htm;
#
#   location / {
#       try_files $uri $uri/ =404;
#   }
#}


# HTTPS server
#
#server {
#   listen 443;
#   server_name localhost;
#
#   root html;
#   index index.html index.htm;
#
#   ssl on;
#   ssl_certificate cert.pem;
#   ssl_certificate_key cert.key;
#
#   ssl_session_timeout 5m;
#
#   ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
#   ssl_ciphers "HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES";
#   ssl_prefer_server_ciphers on;
#
#   location / {
#       try_files $uri $uri/ =404;
#   }
#}


server {

    root /var/www/html;
    index index.php index.html index.htm;

    # Make site accessible from http://localhost/
    server_name domain.com www.domain.com; # managed by Certbot


    location / {
        # First attempt to serve request as file, then
        # as directory, then fall back to displaying a 404.
        # try_files $uri $uri/ =404;
        try_files $uri $uri/ /index.php?$args;
        # Uncomment to enable naxsi on this location
        # include /etc/nginx/naxsi.rules
    }

    error_page 404 /404.html;
    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
        root /usr/share/nginx/html;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php7.2-fpm.sock;
    }

    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    #
    #location ~ /\.ht {
    #   deny all;
    #}


    listen [::]:443 ssl ipv6only=on; # managed by Certbot
    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/domain.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/domain.com/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot



}

server {
    if ($host = www.domain.com) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


    if ($host = hup.edu.pk) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


    listen 80 ;
    listen [::]:80  ;
    server_name domain.com www.domain.com;
    return 404; # managed by Certbot




}

here is my ngnix configuration… Now the website is showing 404 on all pages.. If i restart the droplet then it starts working for 1 minute and then 404 again..
should i move to apache? or am i missing something here? :(

Submit an Answer