zx1905cc
By:
zx1905cc

Migrating Three Wordpress Sites To Subdomains.

October 20, 2014 3.2k views

*Newbie learning as I go! *
I have set up an Ubuntu 12.04 server using Virtualmin and added a blank Wordpress install to "mydomain.com".
All seems to be ok but I need to move three live Wordpress sites to subdomains on the server, how best to achieve this?
I have the plugin "WP clone" but to use this I would need to install blank Wordpress on all three subdomains and another copy of the plugin, I am guessing there must be an easier way. The live sites are on a shared host with Cpanel.
I can use Filezilla and am reasonably competent with a command line, any help would be much appreciated.
Thanks.

1 comment
  • I am not familiar with Virtualmin, so someone else will need to chime in about that; however, I have a couple of questions:

    1. why 12.04 instead of 14.04? Was there a particular reason for that choice? (genuinely curious)
    2. where are your "live" sites currently living? Do you have access to all of the files and folders?

    I would almost go so far to say that if you intend to manage a few websites, you might be better served by starting with a fresh 14.04 install with Apache2, PHP and MySQL, and then configuring things manually.
    The advantage being that you would know exactly where your configuration files are, how they work, and what you need to do to delete/edit/add sites.

    However, if that is too intimidating, and you want to stick with what you have already, then you will need to do a few things to move your sites to your server:

    download all of your site files and folders
    do a MySQL dump (in phpMyadmin it is under "export") of your WordPress database for each site

    then...

    upload all of those files and folders to your server
    create new databases
    import your dumps to those databases
    edit your wp-config.php file to reflect the new databases/passwords

    once you have all that done, you will then edit the DNS for your sub-domains to point to your server
    create your virtual sites (I am guessing) in Virtualmin and set the folders to the ones you created and uploaded all the files to

    then wait and be patient while those DNS changes take place.

    That is it in a nutshell, but you might have more questions and such.

2 Answers

*Thanks for your reply. *
I used 12.04 because I read somewhere it is a good base to build on and there was a tutorial to follow, if starting again with a fresh droplet is needed I will do that no problem.
Researching the net I saw a lot of differing opinions as to what to use for Wordpress sites, some say NGINX is best some say Apache with Varnish, I got a little overwhelmed!
Virtualmin has features to create domains and subdomains but I can not figure out how to import files.
The existing live sites are accessible with Cpanel but I am unsure where exactly to put all the files on my new server, as they are live it would not be good if I make a serious error!
My reason for building the server is to speed up page load times of my Wordpress sites so I want to get it right first time if I can.
The shared host was giving page load times around 5 seconds after I optimized the sites as much as possible, so I thought VPS is way to go.
Thanks again for the input, I am a senior citizen so the learning process is a little slow!

  • Glad to hear you are willing to learn!

    I would say Apache would be a good start. You can add Varnish later, once you get your sites configured properly. But honestly, with DigitalOcean's SSD drives, I think you will find your sites load in split-seconds, even without Varnish.

    For starters:

    I take it from your original post that you are able to SSH in to your server, and can use Filezilla to access your server via SFTP. You will be using both for various things.

    Most likely, the folders you will want to work with for your website files will be in /var/www
    The folders where you can configure your websites are in /etc/apache2/sites-available

    Can you access those?

  • UPDATE Following the suggestion in the first reply I started from scratch again as the Virtualmin panel seemed to using a lot of memory and adding more complexity.
    I discovered "easy engine" and installed that on a fresh droplet with Ubuntu 14.04 and Nginx . I can access the server with Filezilla and have successfully installed one Wordpress site using easy engine.
    My next problem is to migrate another live Wordpress site with three subdomains. I have "backup buddy" installed on the main site so maybe I can use that to help with the migration.
    My biggest concern (apart from screwing up the migration) is the downtime while DNS propagates.
    At this moment I am trying to work out if the Wordpress contact forms will work "out of the box" or if I have to configure a mail server. Respect to you guys that master this technology, I am finding it challenging!
    Thanks for taking a look at my question it is much appreciated.

  • the WordPress contact forms use phpmail, which you can install with:

    sudo apt-get install sendmail
    
    configure sendmail
    sudo sendmailconfig
    

    it will ask a few questions, just accept the defaults.

    then restart nginx (I think with):

    sudo service nginx restart
    

    As far as propagation down time: theoretically, if you have an exact clone of a website on the new server, the public will not notice any down-time...

    Unless....your site is an e-commerce, or takes input of some kind. In this case, you would need to disable all of those things until the site is fully propagated. Otherwise you will have purchases, or comments or whatever in your old database, and not on your new one.

    But if the site is just information, then no one will notice because the domain will be pointing to either the new or the old site, which should be exact clones.

    But that is all theoretical and in a perfect world. The truth is, stuff happens...often there are configurations you miss on the new website, so when it propagates some errors pop up and you end up scrambling to fix things.

    Because of this, I usually start the switch late Friday night, and tell my clients things will be running normally by Monday morning. This gives me the weekend to track how the switch is going and fix problems as they pop up.

  • Thanks for the info about Sendmail, now about to install. I guess it can be set up for more that one site on a server so I will do some research.
    I used "easy engine" to install Wordpress Multisite with subdomains thinking that would simplify things, not sure if it was a smart move but I am learning a lot!
    Regarding installing live sites I have discovered the Duplicator plugin and think that may help me migrate sites onto subdomains, doing some research on that now.
    If not I will dig deep and go for it manually, thanks for your suggestion about the 14.04 set up, on my test site page load times are FAST compared to my old shared host.

  • Multisites can be useful in certain use-case scenarios, but comes with its own set of issues.

    One problem I ran into with Multisites: I hosted several people's websites, and it worked great, but certain people over the years needed to move to their own servers for various reasons.

    Moving a single site OUT of a Multisite install is not as easy or straightforward as when each site has its own install.

    PROS:
    only one site to update WordPress, monitor, etc.
    keeps your admin-time focused on a single install

    CONS:
    if a site needs to move, is not as easy
    some plugins do not work on Multisites
    running backups for each person's website is not as easy..since you need to seperate the content for each site.
    Can be a bear to configure and work properly.

    ..probably some other things I am not thinking of.

  • Hmmm you got me thinking!
    I guessed there would be issues when looking at the Multisite dashboard.
    Maybe its better if I try to figure out a way to install Wordpress on normal Subdomains and bin the Multisite option as I have live sites with specific themes and plugins to migrate.

    My intention is:
    mysite.com
    Subdomain: bodybuilding.mysite.com
    Subdomain: slimming.mysite.com
    Subdomain: tba.mysite.com

    Thank you so much for your input

  • I do not want to completely discourage you from running Multisites. It does have its benefits. But you should be aware of the possible issues as well before you dive in.

    My experience is that all of the issues arose when dealing with other people's websites that I had on my multisite install. Looking back, I would not run someone else's site on a multisite installation, but keep them on their own WordPress install.

    Also: no need to completely bin the Multisite. You can use it to run just one of your sites, and have it on hand if you need to quickly create a sub-domain site, for example, testing and building a theme.

    I keep one multi-site installation going for just such a thing. Is handy because I can create a new site in minutes....then delete it just as easily.

  • Since starting this thread I have made mistakes and had to start again but now have a much better understanding of how Wordpress and file systems work.
    For sure at my age it has been challenging to get my head around the technology but hey, I now have a working server!
    At this point I feel happy working from the command line and do not miss cpanel. For sure there will be other problems for me to solve but its nice to know there are such helpful and knowledgeable people here to lend a hand.
    Thankyou.

Have another answer? Share your knowledge.