Tag Archives: Wordpress

WordPress featured post tile

Moving From Self-Hosted WordPress to WordPress.com

Most people move from the hosted WordPress.com to a self-hosted WordPress (WordPress.org) site. They want the flexibility of a self-hosted WordPress site. In my case I’m going the other way. I’m moving my self-hosted WordPress site to WordPress.com.

Why am I doing this:

  • Simplicity – everything comes from WordPress and is hosted by them. I don’t have to worry about an update to WordPress breaking my theme or a plugin. WordPress.com won’t be perfect, but it is simpler.
  • No more updates – I’m paranoid and want security updates applied immediately. Even if the updates aren’t security related (although it seems most are these days) I hate running old software as I figure there’s a landmine in there just waiting to blow up on me. It seems like there’s a never ending string of updates these days so I spend more time doing maintenance than I do writing or exploring. it doesn’t help that these updates seem to arrive at the worst time.

Some “gotchas”

  • Technically, photos are not exported. They are imported if the old site is online and the photos are accessible by WordPress.com
  • Photos that use relative URLs in posts will not be imported because WordPress.com cannot find them. They must include the full URL.
  • Some of my photos did not get “attached” to the post although they still appeared in the post. This is more a media library management issue. It’s not something that affected me but it may affect you if you really need that mapping. They can be manually attached after the import. See step 8 for more information.
  • If you use the JetPack plugin on your self-hosted site and you want to migrate the data contact WordPress.com support. They can probably migrate the data. I did not use JetPack so did not deal with this.
  • It will cost $13/yr. to map your existing site domain name to the new WordPress.com site. This will allow all exiting external links to still work and search engines will not have to process and re-directions or site renames.
  • If your existing domain is used for anything other than your WordPress site you may need to research the DNS setup. WordPress.com provides good documentation and automation for using Google Apps email along with several other email providers. I use Google Apps for email. I don’t include those instructions here because the WordPress instructions worked fine.
  • There will be a DNS change at the end. To speed this up you may want to lower the TTL for your old sites DNS entries a couple days before making the change. This isn’t critical but may speed things up. I set mine to 30 minutes.

Doing the Move

So here’s the basic process I followed to move this site. The screenshots are from a blog I used to test this process (BWOTAE.COM).

I initially did all my testing and site design on a test blog with a small number of posts and comments. This meant that there was minimal time between when I imported the full site and I actually cut over since I already knew the settings I wanted and the tweaks that would have to be made.. This is recommended.

  1. You’ll need to create an account at WordPress.com, if you haven’t already.
  2. In your WordPress.com account select the “Create Another Blog” button in the “My Blogs” section of your account.
    Screenshot showing the create new blog selection
  3. On the next screen enter an address for your blog. Since we’re moving a blog that already has a domain name this isn’t very important. Do not enter your current blog address. We’re going to transfer the domain name along with the blog. But we need a WordPress.com sub-domain to get going. The first screenshot shows that the address I wanted is already in use.
    Screenshot showing my first selection is in use

    My preferred name is in use, but that’s OK

    Once I pick a name that’s available at WordPress.com I select the option to keep my blog private which means users will need a logon ID to see it. This will be changed once the site is ready to go on WordPress.com.

    Then put in the name of your blog. This can be changed later, so you may want to name this slightly different than your other site so that you don’t get confused during the migration, but other than that there’s no reason not to use the same name as your self-hosted site.

    Then select the “No thanks, I’ll use the free address” selection.

    screenshot showing the initial blog selections

    Pick any available name, make the site private (for now), use the name from your self-hosted site and then use the free address.

    Scroll down the screen and click the “Create Blog” button under the “WordPress.com Beginner” column. You can pick one of the packages if you absolutely know you want all the features. You can add these features later at the same bundle price if you want. There’s no benefit to picking them now. Personally, I do not use the bundles since the add-ons I want cost less than the bundle.

    Screenshot showing the "Create Blog" selection

    Go for it! Create the site

  4. You’ll receive the confirmation message once the blog is created (almost immediately). You can click “Visit your dashboard”
    screenshot of the confirmation message

    Success!

     

  5. Check your privacy settings, You don’t want visitors and you don’t want your site indexed until it’s ready to go. Go to “Reading” under “Settings” and verify that the site visibility is private.
    screenshot showing the private setting

    No guests or search engines allowed.

     

  6. Now go to the Dashboard of you old site, the one that’s self-hosted. Go to the “Export” section under “Tools”. Verify “All Content” is selected as the items to export. Then download the export file.
    screenshot of the export settings

    Export everything

    You’ll be prompted to save the file. I just use the default name and save it to the desktop to make it easy to find. Just remember the name and location.
    screenshot of the file save dialogDo not shut down your old site or change the domain name. The site must remain online to import the photos and images.

  7. Once the file is saved, go back to your new WordPress.com site dashboard. It’s time to import. Select “Import” under “Tools” then click “WordPress as the import type.
    screenshot showing the import types

    Select WordPress as the import type.

    You’ll be prompted to select a file. Select the file you downloaded in the previous step and click “Upload and import”.

    screenshot showing the import file selection

    Pick the file you just downloaded and upload/import it.

    You’ll be prompted to map any authors. This does not mean the authors have any actual posts, just that they are set up as users. Map them as you see fit, which is probably all to your WordPress user. Click “Submit” when you are ready. As previously mentioned your old site must be online so the photos can be imported.

    screenshot showing the assigned authors

    Map your authors.

    You’ll be told that the import is running. Depending on the blog size and current WordPress.com load this may take several hours. (Up to 24 per WordPress.com).

    screenshot of in progress status

    Now we need to wait for the completion email

    You’ll receive an email when the import is done. You may see posts and data appear before the email but be patient and wait for the email, it is still working to import and link things up.

  8. Photos seem to be the biggest import problem area, both in my testing and in the forums. After the import go to the “Media” section (of the new WordPress.com site) and select “Library”. Some things to check:
    Is the number of photos close to the number in your old site? Note that unused photos will not be imported.Do you have a lot of unattached photos? Is this more than what your old site had?

    screenshot iof the media library

    Any unattached photos?

    If you have a lot of new unattached photos you may want to contact WordPress.com support through the forums. In my case the difference was minimal and I didn’t meed them attached. They were in the library and appeared in the correct posts.

  9. Before you start cleaning things up go to “Settings” then “Discussion”. Uncheck “Attempt to notify any blogs linked to from the article”. You do not want to notify blogs just because your cleaning things up. You can turn this back on once the new site is live.
    13-NoNotifications
  10. At this point you want to pick your theme and site design and verify your settings. Then go through your posts and make sure they look OK. Due to the volume I mainly just checked the most recent year and the posts that get a lot of visitors. Your old site should still be up and running. If you post articles or get comments on the old self-hosted site you will need to transfer them over.

Once your new WordPress.com site is ready to go “live” here are the steps.

  1. If you use the JetPack plugin on your self-hosted site go in and disconnect it from WordPress.com. If you don’t do this the old site will remain in your WordPress.com dashboard.
  2. Now we need to buy the domain mapping. In the dashboard of the new WordPress.com site select “Store” then click the “Buy Now” button for “Add a Domain”
    screenshot showing buying a domain

    Go to the store and Add a Domain

    Then select “Map a Domain Name You Already Own”

    screenshot showing order type

    Map a domain you already own

    Enter in the domain name used for your self-hosted site.

    screenshot showing domain entry screen

    Enter in your domain name

    Even though you already said you’ll be using your already owned name you’re told the domain is in use. Verify you didn’t make a typo and then select the option to use the domain.

    screenshot showing the domain already taken screen

    Pick the selection to use the domain.

    Complete the wizard to purchase the domain mapping option.

    The domain will be made the primary domain for your site. If you need to change it you can select “My Domains” under the Store section of the dashboard.

  3. You’ll need to change the DNS servers for your domain. This varies by registrar but the domain servers should be ns1.wordpress.com, ns2.wordpress.com and ns3.wordpress.com. It may take some time for the DNS change to propagate. I’d recommend leaving your old site online for a couple of days to avoid people getting a site not found message.
  4. Time to go public. Navigate to the “Settings” -> “Reading” section of your new site and change the Site Visibility to “Allow Search Engines to index this site”.
screenshot of site visibility

Go Public!

Now your new site is alive an in public. You’ve moved from self-hosted WordPress to WordPress.com hosting. An external links will go to the correct page on the new site, no redirects needed.

WordPress and Other Security Concerns

Security ShieldThere’s been a lot of press recently about increased attacks on WordPress sites, and I run WordPress. At first I considered it BS since it seemed ike a standard brute force attack. Not that I didn’t think attacks were going on, a view of logs on my own small servers shows attacks all the time.  But Brian Krebs published an article about it and I figure he has a better BS detector than me in these matters. So maybe there has been an increase. I figure I’m pretty safe, I don’t use the default accounts and I do use long, complex unique random passwords.

Some reading I did also indicated that the volume of logon attempts could cause resource problems on the server, so I decided I would try to specifically block them. After a few other attempts I decided to go the plugin route and used the plugin Limit Login Attempts. It’s a nice simple plugin that does what its name says. I dislike adding plugins to WordPress but I made a exception in this case. Eventually I hope to figure out a way to block this at the server level. But this will give me some protection and any easy way to get stats on whether or not my site is actually being attacked this way.

I’ve always been good about keeping WordPress and my web server updated with the latest patches, but I decided to reboot it this past Friday to make sure all those updates were really in the running software. Maybe it’s because I come from the windows world where patch reboots are a monthly reboot, but I figured it would be a good thing after having the server online for 220 days. So apologies to anyone trying to access the site this past Friday during a certain 9 minutes (I decided to do a full backup with everything shutdown for good measure).

It’s only been a day, but so far the only lookout has been from my testing

Apple (and other) 2-Step Verification

Apple added 2-step verification to their iCloud and iTunes accounts. I have to admit I like it. I especially like that they turn off any sort of password recovery that could be socially engineered. If I lose all the registered devices and the emergency recovery key then I’m screwed. But I’ve always wanted the option to tell these high-value vendors to disable password resets based on those stupid “pet name” security questions. I usually answer them with garbage, but the fact they exist worries me. Not necessarily for every little account, but for any that protects something of value.

I’ve also been going through and adding two-step verification to my other accounts that support it. Some places have apps that generate a token, or use the Google Authenticator App, but codes sent via SMS seem to be the most common. I guess SMS can be spoofed, but I suspect that doing so would have to be highly targeted and take more effort than I’d be worth.

os and software text

Updates, Updates, Updates and More Updates

There have been a lot of updates this past week. Much to my relief most of these updates went smoothly. The main problem were with the updates to this site but I half expected it so allowed extra time to get them done and I did plenty of backups before starting.

WHS 2011 Update Rollup 4 & More

I was happy to see WHS 2011 is alive and well within Microsoft, even if it has been marked for death. Tuesday’s patch bundle included Windows Home Server 2011 Update Rollup 4 with 10 documented fixes. I’m pretty aggressive in keeping my WHS box up to date so it was updated back in November, but it still had 8 patches waiting in addition to the rollup.

I generally take Microsoft’s default selections when I chose which patches to install then do the unselected ones after, if they are still needed. In this case I also unchecked UR4 and started the update.

A couple updates failed and I selected them and the other remaining updates after the reboot, only excluding UR4. It was fine this time and UR4 was successfully installed after that reboot. The connector updates were then pushed out to the clients automatically. This required a reboot, but that was done when the client patches were installed.

No problems so far.

Windows 7 & Windows 8 PCs

Lots of updates all around and they all needed reboots. Windows RT got its share of patches, including a firmware update. I haven’t noticed any difference but some report better performance.

Windows 8 threw in another patch on Thursday which also required a reboot. These are annoying since I run a lot of apps and unlike my Macs they don’t restore running apps automatically. So while the actual reboot is fast, it’s a frustrating 15 minutes of preparation and recovery.

Mac OS X

My new Mac Mini had a BIOS update related to HDMI monitor connections. I haven’t had an issue. My monitor goes through an adapter to the Mac’s HDMI port. I’ll be moving my old Windows monitor to the Mini and then it will be HDMI direct. So probably a good update to have.

The iTunes 11 update wasn’t problem free. But the new bugs were minor compared to the nightmare that is iTunes anyway. More on this in a future post.

Debian 6 and WordPress (My Web Server)

WordPress LogoThis was the big one for me. Just about every major software component of this server was slated for an update. Apache, MySQL, PHP and WordPress all had updates waiting. I held off on the Apache, MySQL and PHP updates until WordPress 3.5 was released. I’d do it in two phases – everything except WordPress, then WordPress. Of course, before starting I did a full server snapshot backup and a file system backup of my web server.

The OS updates and Apache, MySQL and PHP updates all went fine. Everything tested out OK after the update. Then the problems began.

The WordPress upgrades on my test sites only had issues on the ones using the new Twenty Twelve theme. The theme is now part of the core WordPress installation and I install through Subversion (svn). The sites were broken until I deleted the Twenty Twelve directory and re-ran the svn update. That wasn’t going to be a problem on this or my other production sites since they didn’t have the Twenty Twelve theme installed.

I saved this site until last, since it’s my biggest one. So naturally, that’s when the problems began. Short version – the SVN update went horribly wrong. It was possibly self-inflicted. I had deleted the old Twenty Ten theme since I never used it. SVN didn’t like that and threw an error. This must have affected the rest of the update. While pages were still being served from the cache, the site was basically down.

I spent some time trying to work around the error but without success. Finally I did a fresh WordPress installation to a temp directory using Subversion. Then I copied those files over the installation for this site, being careful not to overwrite or delete and files I added or changed. After that, and a restart of Apache all seems fine.

Tools Tile

What I Use: Web Server

Tools TileWith my recent web server changes it’s a good time to update what I use on my web server. I run the site on a “Linode 512” Virtual Private Server from Linode. I’ve been with them since December 2009 and signed up for another 2 years back in January. It’s been problem free and my initial server stayed online for over 300 days at one point, only getting a reboot when changes made it necessary and I did the reboot. It’s a VPS server without any control panel but it suits my needs. There’s no support beyond the making sure the server is running, but they have an extensive document library. All administration is over SSH and from the command line.

I switched to Debian 6 as the OS with this months move. I’d been running Ubuntu, which is Debian based, so there wasn’t much of a change. I’d been having a few minor issues with Ubuntu so decided to switch. I can’t say of the problems were introduced by the Ubuntu or something else.

I run Apache 2 as the web server. With the latest move I switched from using pre-fork MPM with Apache to using Worker MPM. For PHP is use mod_fcgid and mod_actions rather than mod_php. This certainly uses less memory resources, performance seems about the same although some benchmarks do show improvement.

The site runs on WordPress and uses the Catalyst Theme. I’ve been using WordPress since I first created  a website so I obviously like it. I also like the Catalyst Theme, my main complaint is shared with all framework type themes. There’s some lock-in if heavy use of theme-specific features are used. I use the following WordPress plugins: Akismet (anti-spam), Contextual Related Posts, Fast Secure Contact Form, FeedBurner Feedsmith, Google XML Sitemaps, No Self Pings, Recently Popular, Redirection, Skimlinks, WordPress Popular Posts, WP-Piwik, WP Super Cache, WPTouch Pro. I also use the Google Analyticator plugin but will be dropping it when I drop Google Analytics at the end of the month.

For site analytics I just started using Piwik, an open source counter-part to Google Analytics where I maintain the data. There’s also an iPhone/iPad app for viewing the data. As I write this I still use Google Analytics but plan to drop it at the end of the month.

For DNS I use DNS Made Easy for this websites DNS service rather than the registrar’s own DNS. I find it to be more reliable and has more features.

For backups I use Linode’s backup service to get a full server backup and snapshots before updates. My website files and databases get backed up to my home network using rsync.

Tools Tile

Moving Day – A New Web Server

Tools TileI completed moving this website to a new server over the past weekend. I’m still using Linode as my host and running on a 512 MB Virtual Private Server (VPS). The changes were minor and should be transparent. I moved from Ubuntu to Debian as the OS but since Ubuntu is based on Debian there’s not too much difference. I had a few strange things happen on Ubuntu after updates so I’m hoping for a little more stability without actually having too learn anything new. Of course, soon after going live I had problems which seemed to be related to an update on Debian. So much for stability as a reason.

As I was building the new server I also worked to squash some annoyances and did some testing. I’d been having problems posting updates through xmlrpc (for example, from Windows Live Writer) to all my sites except this one. That problem didn’t exist on the the new server. I also had some scripts which stopped working as expected and these worked fine on the new server.

The major change (relatively speaking) was I switched Apache from using pre-fork MPM and mod_php to using worker MPM and mod_fcgid.  Worker-MPM was the default when I installed Apache on Debian so it was easy enough to get Apache working. Getting mod_fcgid and mod_actions to handle php was a little more complicated but not too bad. This has reduced the memory usage by the server since php isn’t running with each Apache instance. Performance seems to be about the same.

I considered switching to nginx from Apache but I decided I didn’t want to much change and I didn’t want to spend the time learning nginx. Staying with Apache meant that I would be keeping most of my configuration. Maybe sometime in the future.

I only made a couple changes to WordPress itself. There were some updates related to security keys in the WordPress configuration file. It’s been awhile since I updated that file so I was missing a lot of keys. Now I have all the keys and salts used by the current version. I also changed the database name and user to match my current naming convention.

My checklist for the move is below:

  1. Set the DNS TTL for the domain(s) to a low value (300 seconds) so the DNS change will take effect quicker for the actual move. Do this a couple days in advance.
  2. Backup all website files.
  3. Backup the database
  4. Backup the Apache site file
  5. Create the database on the new server – use the same name as the old server
  6. Create the database user – use the same name/password as the old server
  7. Copy the website files from the backup to the new server
  8. Copy Apache site file to the new server – edit the file for any changes such as IP address the site is on
  9. Restore the database from the backup
  10. Edit hosts file on new server so that the server resolves to itself for the website
  11. Edit hosts file on my PC so it resolves to the new server for the website
  12. Edit my permissions scripts to set file permissions for the site. Run the script to set/test permissions (I have a script I keep updated that will set the proper permissions each night in case I change them and forget to change them back or they get changed in an update.)
  13. Edit backup scripts to include the new site.
  14. Edit WordPress update script to include the new site (I update WordPress through svn)
  15. Update logrotate to include the new site
  16. Connect to the new server’s WordPress site (using the PC with the modified hosts file)
  17. Delete cache files for WP-Supercache and restart plugin (this plugin seemed to dislike being moved). Check the rest of the plugins.
  18. Test the website on the new server
  19. Make a minor change on the new site so it can be identified
  20. Change the DNS from the old server to point to the new server
  21. Allow some time for the DNS change to propagate. Access the site from a different PC or remove the entries from the local hosts file. It may be necessary to flush the cache when changing the local hosts file.
  22. Allow a few days to pass. Check the logs on the old server and if there’s no access (except some search engines and other web spiders) the server can be shut down.

The move itself went smoothly.