1 0 Tag Archives: migration
post icon

And we’re back…. On wordpress

So my fairly short lived experiment with migrating my Blog to SharePoint is over.   As much as I love SharePoint it really isn’t a great platform for public blogging, at least using the out of the box blog template.

There are some major limitations that caused me to switch back:

 

  • Because the solution runs in the sandbox I can’t make any outbound HTTP requests from my custom code.  This means that even if I wanted to write a custom comment handler to use a spam filter like Akismet, I can’t.   The result was that I was getting hundreds of spam comments on my blog. 
  • There is no URL rewrite support so all of the URLs on the new blog were simply “Post.aspx?ID=XX”.   This is crap for search engine optimization.
  • The comment capability doesn’t allow for anonymous users to specify their name and email address.   This meant that all comments were anonymous.

Overall it was a fun experiment and I learned a lot about sandbox solutions and online hosting.   I think I’ll stick to wordpress at least for now though as I have considerably more flexibility with it.

For historical purposes though I still have the Visual Studio project available that I used to create the sandbox solution here:  http://vallery.net/wp-content/uploads/2012/01/ValleryBlog.zip

Leave a Comment
post icon

Blog migration to SharePoint

 

You can find the source code for this entry at:  http://vallery.net/wp-content/uploads/2012/01/ValleryBlog.zip

So I decided to migrate my blog from WordPress to SharePoint.   The motivation was driven primarily out of wanting to “eat my own dogfood”.    Given that most of the work I do and the posts on my blog all have to do with SharePoint I thought it would be appropriate to actually host my blog with SharePoint.  

I decided to seek out a hosting provider which specializes in “SharePoint in the cloud” given that my blog is high enough traffic and important enough to me that hosting at my house isn’t an option.   I first turned to Microsoft’s Office 365 service given that I’m already hosting my personal email with them.    I was disappointed to learn that you currently cannot host a public facing website with anonymous access.   They require the site to be secured which wouldn’t work for a blog.

I emailed a couple of the other community hosting options and got a very nice reply from FPWeb.   One of the services they offer gives you a single site collection on SharePoint Foundation which you can optionally give anonymous access to.   The site is limited in terms of which SharePoint features are available but they did offer the blog template.  If you’re not familiar with the differences check out this great guide which details the plans that are available.   The site provided uses SharePoint hostname site collections which allows me to have a fully qualified domain name (http://blog.vallery.net/) point to a single site collection on their web application.  

For my use case there were a few limitations that bit me:

  • Deployed custom solutions must fit into a “Sandboxed Solution”.    This is true for any of the non-dedicated online SharePoint option though so not an issue with FPWeb specifically.    This means that many of the things I’m used to doing for my customer’s on-premise installations are not possible in the cloud.   Microsoft has a good list of the limitations of SandBoxed solutions worth reading.  The things I missed the most are:
    • Ability to create custom delegate controls.    This made doing a custom searchbox a bit more difficult and less flexible than I’d like.
    • Ability to integrate with external systems.   My current WordPress based blog will post to twitter automatically when I write a new article but given that no external HTTP requests are allowed I can’t write an event receiver to do that for me.
    • I have to deploy all style assets to the SharePoint “Style Library” because I can’t write to the file system.    This could potentially have a negative impact on performance because now they live in the database.
    • I wanted to create a few custom controls to handle some of the style elements.   For example the banner on the site isn’t as flexible as I’d like.   It should really pull the title, url, and description from SPContext.current.web.   I had to hardcode them into the masterpage which means my solution isn’t portable.
  • Since FPWeb only provides SharePoint Foundation it makes branding more difficult.   There are a number of capabilities found in the enterprise publishing features that I typically use with my customers which were unavailable to me. 
    • In a custom masterpage you can use the SPUrl object to find a the URL of the site collection or site in order to reference your style library (to include CSS, JS, and images on the page).   This is not available if you don’t have enterprise so I had to hard code the path to the Style Library into the masterpage.   On my development box I created a blog site collection in a managed path off the root which made the path different than my site here at FPWeb (which is the root site collection).   This caused me to have to make a quick change every time I switched from my dev box to pushing out the solution to FPWeb.
  • Search is limited given that it is only SharePoint Foundation.  This is fine because I only need a site scoped search anyways.   The trouble of course is that it turns out the control that is used is very different.   I styled the Enterprise version since that is what I had on my dev box.   Once I deployed to FPWeb I discovered that none of my styles worked.   I had to go back and refactor for the foundation search box.   It wasn’t a huge issue but it took me a while to figure out why my styles weren’t working!

Once I got my solution done with my custom style I needed to get all my old content off my WordPress blog and onto SharePoint.   I had some good conversations with Metalogix at their booth during the SharePoint conference in Anaheim so I was already familiar their "Migration Manager for Blogs and Wikis" product.   They were kind enough to give me a trial key which was enough to migrate my posts and comments from wordpress across.   The process was painless and just required confirming the source and destination.   It was able to capture metadata as well like category which was handy.  

I did discover a few issues with the way the data was migrated though.  I realized that the blog author for all of the posts and comments was listed as me.   I guess this make sense since the author field is tied to a people picker and needs to be a person.   None of the comment authors in wordpress are users in my SharePoint environment obviously.    Metalogix handles this by creating a couple of extra columns on the comments list which store the original comment author, name, and email address.   I plan on writing a custom XSLT file and view to parse this at some point to place this information onto the page.  I’ve also included these fields on the new comment dialogue so I can capture it for future comments.  For now though I’m listed as the comment author for all of the comments.

The only issue I had with the Metalogix tool is the moving of images.   This could easily have been my fault as well so I don’t want to blame the tool.   My posts had a number of embedded images which WordPress stored in the wp-content folder.   My expectation would have been that Metalogix would have grabbed those files and put them into SharePoint and updated the references.   It even looked like it attempted to do that however I received a bunch of error messages which indicated failure.   My images are still linking to their original source on my WordPress site (which is still up) so they are not broken.   One of my todo items is to migrate those across by hand and then update my old posts that reference them.     This will give me an opportunity to clean up my old posts anyways which I’ve been meaning to do for a while.

With everything up and running I put 301 redirects into the .htaccess file on my WordPress server for each post.   I pulled out a list of all the posts from the SharePoint list and matched them up to their original URL (which thankfully Metalogix stores in an additional column for me).   With all of these URLs known I’m able to redirect the deeplinks to their specific posts.   WordPress has the handy SEO optimized permalinks which SharePoint does not.

Overall I’m very satisfied with both FPWeb and Metalogix.  Without either of them this project would have been significantly more difficult.   If you can accept the limitations of hosting your SharePoint site in a shared environment then I highly recommend FPWeb.

In case anyone is interested in the actual development work that was involved with the branding in all this I’ve posted my Visual Studio project.  In total I spent about 15 hours on the entire project over my Thanksgiving weekend. You can download the project at http://vallery.net/wp-content/uploads/2012/01/ValleryBlog.zip.

Leave a Comment