Migrating from wordpress.com to wordpress.org

A while ago I migrated a site I manage from wordpress.com to wordpress.org mostly because I wanted to do ecommerce on the site, and made a few notes with the intention of writing up a blog post about it.

My notes say:

  • Migrate wp.com -> wp.org
  • Create vps
    • Update system
  • DNS
    • Transfer Domain
      • Change registrar (not in notes)
      • Change DNS server location (not in notes)
  • php
    • fpm
    • inifile
    • mysql mysqli
  • nginx
  • mysql
  • dns
    • ttl 8400 (1d)
    • refresh 14400 (4h)
    • retry 7200 (2h)
    • expire 1209600 (2w)
    • Records
  • hostname
  • timezone
  • domain name
  • mysql
    • config
  • nginx
    • config
  • fpm
    • config
  • wordpress
    • install
    • import

Now a lot of this even I’m having trouble really remembering the details of, but I think that I’m going to try to give at least a little bit of information about each of these steps.  I do know that several of these things could easily be a separate post.

Migrate wp.com -> wp.org

I decided to do this, and some of what I am doing I would not really recommend doing the way I am, unless you are already leaning in this direction.

One thing in particular about this is that while I personally use gentoo as my preferred distribution, I think that this is not a good way to go for system critical stuff, unless you are quite familiar with it, and are happy with how things work with it.

I personally have two computers at home running gentoo, and most of my linode “nodes” running gentoo, so it works well for me.  I like the way it works, and it can be difficult to switch from one distribution to another.

Also, while I have found that I can do good jobs of breaking my gentoo boxes, I usually realize that there was something I shouldn’t have done, and relatively quickly what it was, and why it was bad.  On at least one distribution I have found that I tried to do some stuff with it, and I did know what I did wrong, but I didn’t know why I should have known that it was wrong, which was why I felt that gentoo (for me) was going to be better than what I was using, as I still couldn’t tell why following the recommendation given, should have set a red flag, without deciding that similar advice was best to avoid.

So, while the update process can really load the server a lot, it can be a problem on machines which are in major production and are regularly used “at any time.”  So, I guess that is some ideas that I have been coming from.

Create vps

I run my public machines (or machines which need to be accessed from somewhere other than a private location) on Linode, and they have the option to create a volume with Gentoo on it.  So, I am pretty good with that.

When I create it I try to make sure there is a good sized swap, and I try to keep some “spare” unassigned space for the rest.  I have found that only with one system I’ve run into a situation which I was swapping, and I think one thing there was I was doing it in a “reasonable” way to test the server, but not a good way to really run an active server (using sqlite rather than postgresql).

The thing with Linode is they have a “node configuration” rather than pick and choose type system, and I have found that for the most part this ends up with overprovisioning one or more parts of the server (processor, memory, storage), but it seems to be cheaper than the cases where I could adjust each individually.  “swapping too much” add more memory, “running out of drive space” add more storage, “processor running too high a percentage” add “another core”.

Also, so far linode has been good with support.  In fact way better with support where the host has been a lot more expensive.  The one reason I went with a different one, was that I hoped/expected that certain sites the Linode server was “too big” by at least a factor of 2 on all aspects.  And honestly I think that in a lot of ways it probably was, if I was doing a low use, and low load site (largely static).

Since then, linode has started offering such a machine.  Which is great for sites where I’m developing my own site from the ground up, as I want them to be able to run (unless they become high demand) on small machines like that.

Update system

Once I have provisioned the server, I boot it up, and start the update process.  This is really important especially with gentoo that even though you “could” start installing your software right away, it’s far safer to just try to get things updated and running as the latest version.

Gentoo packages are usually in 3 different states of being able to be installed (if they exist in your “tree”) that being “stable”, “testing” or “masked”.  I tend to run with “stable” as the default, and use “testing” if I need to.  Masked almost always poses problems, unless the reason the package is masked (these are almost always given) is something you decide “yes this is really what I need to do”.

So, when I update, I tend to do:


$ emerge --sync
$ emerge -uDaNt @world

for my update, but sometimes that is not the best way to go, and on gentoo you usually get something like “portage has an update available it’s recommended…” or if it is more than that it gets listed as a “news” item which it is worth looking at before diving into something like a complete system update like that.

That said, the emerge --sync usually won’t cause problems, and may give you an idea of where to go better (there can be new news items pulled in).

So, one thing which is often complained about with gentoo is that whenever you try to install, update, or pretty much do anything like that it takes a long time, so this becomes something where when I am doing that, I will do other stuff while I am waiting for that (right now I’m writing this while doing a new server which will host email for my ActivityPub stuff to start off with, but eventually all of the email for all of the domains I maintain), so I went and did some long time to process (usually) stuff in this case setting up DNS, or at least the first stages of that.

DNS

There were a few things I wanted and/or needed to do with this but I needed to first off get the DNS to be able to point to the new server, and that meant that I needed to switch at the very least the DNS servers which would serve that.

I also really wanted to drop my current two registrars as they are both forcing Domain Protection Services on me, meaning the domain when it is queried shows up with “anonymous” data for it.

This used to be an “add on” service which some registrars would promote highly because it protected you from unscrupulous people on the internet, and it was promoted as a “very good idea”. But I never really bought into that “very good idea” for a main thing of I didn’t care enough to in many cases end up paying about 60% of the domain registration to “hide”. And that didn’t make sense to me.

Then I read of cases where people who legitimately had registered a domain, ended up having the domain transferred away from them, and they’d had this data set, and because of that had a lot of trouble with getting control of the domain back because they had a lot of trouble proving that the “anonymous person” was the person that they really are.

I contacted one of the registrars twice about this, and their answer was very unsatisfactory. So I decided that it was time to move away from them (I’d also had other very unsatisfactory responses from them about several other issues. So I decided to do that as well.

Transfer Domain

With these two different things that I was processing I decided that I needed to think of how to do this. So my way of handling this (and I really think it is safest to do this way) was to transfer the registration to the new registrar (webnames.ca) and then change the DNS server records from there.

Change registrar (not in notes)

Changing to the new registrar ended up being a bit of a problem, and I think that I have to try to remember how this works:

  1. Unlock domain (allow transfer) at old registrar
  2. Request transfer at new registrar
  3. Approve transfer at new registrar
  4. Approve transfer at old registrar

It all seems simple enough, but I have now done this process twice between the same two registrars and have not managed to do it smoothly between these two registrars. So, I have to say while it seems simple, sometimes little things like not noticing something equivalent to a “click here” type link can be a bit of an annoyance.

Change DNS server location (not in notes)

Once I got the domain at the new registrar, I switched the DNS servers to my linode DNS servers.  This was pretty simple.  It transferred all the data from the previous registrar, but the DNS servers were set to wordpress.com and that needed to change as I was moving away from them.

So, just delete those records, and add the ones that I need for linode.com

php

WordPress needs php, as that’s the programming language they use, and you can’t “just get a binary” and even if it was a possibility gentoo would probably not have a binary only option for something that it runs from source, unless the package is so large that it’s deemed that both source and binary versions are available.

So I needed to install php, I could do things through emerge and simply emerge wordpress and get everything built how gentoo believes it should be.  The problem I have had with that idea, is that often the way it installs ends up with still more work than having installed it from with just the dependencies installed manually.

fpm

I use nginx as my webserver of choice, and it likes (and so do I right now) fpm as the way to handle running php.

inifile

I can’t remember why this was needed, but for some reason I felt that it was.

mysql mysqli

WordPress needs MySQL support, so I used both use flags that should bring it in.  I’m not sure which actually is needed, or if it figures out what best to use, based on what is available.  I don’t really know, though I could look.

nginx

I think that either with setting up PHP it set everything that was needed for nginx I just needed to install it.

mysql

MySQL just needs to be installed, I think I probably installed mariadb rather than mysql, as there are some improvements in mariadb that aren’t in mysql, and some of them are pretty important.

dns

This could have been setup earlier in the process so that at the point I got to here, this would already be working, but I hadn’t so I needed to set this up and then step back for a bit to get things so that DNS was working.

Timings

  • ttl 8400 (1d)
  • refresh 14400 (4h)
  • retry 7200 (2h)
  • expire 1209600 (2w)

These are the various timings that I like to set.  They allow for a faster update of DNS records when I change things, and they mean that if for some reason something happens with the DNS records that I’m serving, and that they aren’t being served for whatever reason I have a bit of time (in theory 2 weeks) before everything should break.

Records

The next thing to do was to setup the records, some of which I could copy straight from the old ones (because they should work moving to the new servers) and others I needed to update to point to the new servers.

The thing with linode that I like compared to other places I’ve hosted DNS records (ie. I’ve used their DNS servers for my sites) is that from what I can tell, unless you are doing something “really weird” and more specifically also “dangerous” they really let you set things as you wish.

hostname

Setting the hostname of the machine was important because it gets confusing when it’s not set, and also certain things don’t work properly when it’s not set.

timezone

I always leave this until the point I look at the logs and go “um, when was that exactly” and realize that they are listed in some other timezone (most commonly UTC).  So I need to set the timezone mostly for convenience for myself.

domain name

This I don’t think I ever figured out how to get the server to fully recognize what the fully qualified domain name (FQDN) is, but that’s probably down the road a bit.

mysql

At this point I have everything setup on the server to start bringing the needed services up so I started with mysql, for no real reason really.

config

Certain configuration needs to be set in order to even start looking at setting this up.  Gentoo does not automatically do this, and while it’s a bit annoying to not be able to just start it, it is quick to do the configuration.

nginx

nginx is the web server, so setting this up is really important.  It’s something that takes a bit of practice, and some projects love to use nginx, others apache, and that seems to be the two primary ones that you can get easy instructions for.  Most projects default to apache as it has historically been the more popular server of the two, currently it is a bit of a tossup as to which is the more dominant, they are getting very close to the same number of site.

config

Configuring nginx can be a bit of a pain.  Especially if you’re transferring your configuration from apache.  I don’t really know about other ones.

fpm

fpm is how PHP works with nginx (or at least a common and recommended way) so this needs to be setup.

config

Once you have a working configuration of fpm, changes to make it “work better” seems to be pretty good.  It takes a little while to get it working in my experience, but moving from one site to another it’s a lot easier once you’ve done that.

wordpress

I install wordpress based mostly what is on the wordpress.org site.

install

Follow the instructions on wordpress.org.  This works well on gentoo once you have the main stuff setup.

import

Importing stuff from the old server first takes exporting it (which I failed to note, I think because I had done that already and didn’t need to do a new version as nothing had changed).  I’m not quite sure how I managed the moving of the media files over to the new site, but we have done so.  It was pretty simple, and because of how the old site was, it was pretty quick and easy to check that everything was working.

Conclusion

While this is mostly just a brief outline (honestly it is pretty brief as I could easily write close tho this whole length for each of 6 more posts to handle this, but mostly I just don’t have the notes to manage that right now so will need to do another similar migration, though I don’t see that happening any time soon.

I really would like to write something more about the basics of setting things up for a new server through linode as it is currently done.

This entry was posted in Business News, Computer Support, ECommerce, Linux, Site News, Web Development. Bookmark the permalink. Both comments and trackbacks are currently closed.