次の方法で共有


Migrated to Azure Web Sites

I’ve been thinking about moving this blog over to Windows Azure for a while,
but I’ve finally got around to it, and it has to be said the experience was
pretty simple. Previously I’d experimented with Windows Azure Cloud Services,
specifically packaging it up as a web role. However, this blog is powered by WordPress, which is PHP and MySql based, so
this wasn’t the simplest process in the world, and left quite a lot to be
desired when it came to enabling and using all the WordPress features, like
being able to use plugins without having to repackage the web role. But then Windows Azure Web Sites comes along, and
migrating was simple.

In case anyone else is looking to do the same, here’s the steps I
followed:

  • Backed up all the files from my blog at my existing hosting provider (in
    this case copied everything locally via FTP)
  • Exported the MySql database at my existing hosting provider to a local SQL
    file using MySql Workbench (yes, I know I could do
    this with a command line, but I like GUIs!)
  • Logged into the Windows Azure Management Portal and created a new Windows
    Azure Web Site from the gallery, and selected WordPress as the template
  • I didn’t bother setting up WordPress as I was going to copy over everything
  • Connected to the new Windows Azure Web Site via FTP, and copied over all the
    files I backed up from my existing provider
  • At this point the site mostly worked as it was connecting back to my
    existing MySql database
  • Logged into the WordPress Dashboard to reconfigure the site URL to the
    Windows Azure Web Site URL
  • Connected to the new MySql database created by the Windows Azure Web Site
    WordPress template with MySql Workbench, and imported the export I took earlier
  • Opened up the wp-config.php file in the root of the web site, and
    reconfigured the MySql database connection information
  • All done!

Well, when I say all done, I mean that WordPress, with all my content and
options, is running in Windows Azure. However, I also had to move all the DNS
for phazed.com over too, and that’s where I tripped over a little. You can
certainly do this with Windows Azure Web Sites, you just need to use a reserved
instance, add a CNAME in your domain for the Windows Azure Web Site hostname,
and then add a custom domain to your Windows Azure Web Site. This is all
explained quite well here:

https://social.msdn.microsoft.com/Forums/en-US/windowsazurewebsitespreview/thread/2a22b012-dc80-4f7a-9500-2a5ff628b5c4

There’s a caveat however. At the moment you can only add custom domains using
CNAMEs, which is practice means I can add www.phazed.com for
phazed.azurewebsites.net, but not phazed.com (without the www). Apparently it’s
coming, but this was a problem for this blog as all the permalinks used
phazed.com, not www.phazed.com. I won’t bore you with the details of how, but I
got around it by adding some redirection at my DNS hoster for phazed.com to
www.phazed.com, and bulk editing the contents of the database export before
importing back into the new MySql database.

Anyway, it’s all done, and I’m quite pleased that’s the blog is finally on
Windows Azure. It’s even a little faster I think!

Original post by Rupert Benbrook on July 12th 2012.