Surendra Sharma

Surendra Sharma

Search This Blog

Friday, December 2, 2016

LexBlog To Sitecore - Part 1 - LexBlog Basics



Sitecore again proved itself as a no. 1 CMS platform as per Gartner ratings and hence more and more customers are attracting towards Sitecore. 

Some customers already have their business and organizations websites however some customers are looking to launch new web solution for their business. For both type of customers Sitecore provides an excellent opportunities to grow their business in a digital world.

So more customers means more business which is good for Sitecore, good for companies who are working on Sitecore and so great for Sitecore developers communities. So it’s a win-win situation for all of us.

If solution providers can migrate and help in relaunching of customers existing websites in a short period of time then it will be great for the organization who already running website and looking to redeveloped their website in Sitecore.

This article is about moving WordPress based LexBlog solution to Sitecore. By using below technic anyone can move LexBlog articles to Sitecore within a hour.     

What is LexBlog?

LexBlog is a platform for providing blog for legal professional, firms etc.

LexBlog is built on top of the WordPress.



LexBlog XML Format


You can take backup of LexBlog site into XML file. Below is a sample XML file for the same.

<?xml version="1.0" encoding="UTF-8" ?>
<!-- This is a WordPress eXtended RSS file generated by WordPress as an export of your site. -->
<!-- It contains information about your site's posts, pages, comments, categories, and other content. -->
<!-- You may use this file to transfer that content from one site to another. -->
<!-- This file is not intended to serve as a complete backup of your site. -->

<!-- To import this information into a WordPress site follow these steps: -->
<!-- 1. Log in to that site as an administrator. -->
<!-- 2. Go to Tools: Import in the WordPress admin panel. -->
<!-- 3. Install the "WordPress" importer from the list. -->
<!-- 4. Activate & Run Importer. -->
<!-- 5. Upload this file using the form provided on that page. -->
<!-- 6. You will first be asked to map the authors in this export file to users -->
<!--    on the site. For each author, you may choose to map to an -->
<!--    existing user on the site or to create a new user. -->
<!-- 7. WordPress will then import each of the posts, pages, comments, categories, etc. -->
<!--    contained in this file into your site. -->

<!-- generator="WordPress/4.3.2" created="2016-08-16 18:56" -->
<rss version="2.0"
       xmlns:excerpt="http://wordpress.org/export/1.2/excerpt/"
       xmlns:content="http://purl.org/rss/1.0/modules/content/"
       xmlns:wfw="http://wellformedweb.org/CommentAPI/"
       xmlns:dc="http://purl.org/dc/elements/1.1/"
       xmlns:wp="http://wordpress.org/export/1.2/"
> 

  <channel>
    <title>My Sample Blog</title>
    <link>http://www.sampleblog.com</link>
    <description></description>
    <pubDate>Tue, 16 Nov 2016 18:56:42 +0000</pubDate>
    <language>en-US</language>
    <wp:wxr_version>1.2</wp:wxr_version>
    <wp:base_site_url>http://engage.lexblog.com/</wp:base_site_url>
    <wp:base_blog_url>http://www.sampleblog.com</wp:base_blog_url>

    <wp:author>
      <wp:author_id>1</wp:author_id>
      <wp:author_login>admin</wp:author_login>
      <wp:author_email>development@lexblog.com</wp:author_email>
      <wp:author_display_name><![CDATA[LexBlog Admin]]></wp:author_display_name>
      <wp:author_first_name><![CDATA[LexBlog]]></wp:author_first_name>
      <wp:author_last_name><![CDATA[Admin]]></wp:author_last_name>
    </wp:author>
    <wp:author>
      <wp:author_id>1011</wp:author_id>
      <wp:author_login>stevejob</wp:author_login>
      <wp:author_email>steve@sampleblog.com</wp:author_email>
      <wp:author_display_name><![CDATA[Steve Job]]></wp:author_display_name>
      <wp:author_first_name><![CDATA[Steve]]></wp:author_first_name>
      <wp:author_last_name><![CDATA[Job]]></wp:author_last_name>
    </wp:author>
    <wp:author>
      <wp:author_id>1774</wp:author_id>
      <wp:author_login>author1</wp:author_login>
      <wp:author_email>Manoj.Gupta@sampleblog.com</wp:author_email>
      <wp:author_display_name><![CDATA[Manoj B. Gupta]]></wp:author_display_name>
      <wp:author_first_name><![CDATA[Manoj]]></wp:author_first_name>
      <wp:author_last_name><![CDATA[Gupta]]></wp:author_last_name>
    </wp:author>
    <wp:author>
      <wp:author_id>1775</wp:author_id>
      <wp:author_login>author2</wp:author_login>
      <wp:author_email>Rakesh.Varma@sampleblog.com</wp:author_email>
      <wp:author_display_name><![CDATA[Rakesh Varma]]></wp:author_display_name>
      <wp:author_first_name><![CDATA[Rakesh]]></wp:author_first_name>
      <wp:author_last_name><![CDATA[Varma]]></wp:author_last_name>
    </wp:author>
    <wp:author>
      <wp:author_id>1776</wp:author_id>
      <wp:author_login>author3</wp:author_login>
      <wp:author_email>Satish.Goyal@sampleblog.com</wp:author_email>
      <wp:author_display_name><![CDATA[Satish F. Goyal]]></wp:author_display_name>
      <wp:author_first_name><![CDATA[Satish]]></wp:author_first_name>
      <wp:author_last_name><![CDATA[Goyal]]></wp:author_last_name>
    </wp:author>

    <wp:category>
      <wp:term_id>45</wp:term_id>
      <wp:category_nicename>category1</wp:category_nicename>
      <wp:category_parent></wp:category_parent>
      <wp:cat_name><![CDATA[Category 1]]></wp:cat_name>
    </wp:category>
    <wp:category>
      <wp:term_id>46</wp:term_id>
      <wp:category_nicename>category2</wp:category_nicename>
      <wp:category_parent></wp:category_parent>
      <wp:cat_name><![CDATA[Category 2]]></wp:cat_name>
    </wp:category>
    <wp:category>
      <wp:term_id>47</wp:term_id>
      <wp:category_nicename>category3</wp:category_nicename>
      <wp:category_parent></wp:category_parent>
      <wp:cat_name><![CDATA[Category 3]]></wp:cat_name>
    </wp:category>

    <wp:tag>
      <wp:term_id>41</wp:term_id>
      <wp:tag_slug>tag-1</wp:tag_slug>
      <wp:tag_name><![CDATA[Tag 1]]></wp:tag_name>
    </wp:tag>
    <wp:tag>
      <wp:term_id>42</wp:term_id>
      <wp:tag_slug>tag-2</wp:tag_slug>
      <wp:tag_name><![CDATA[Tag 2]]></wp:tag_name>
    </wp:tag>
    <wp:tag>
      <wp:term_id>43</wp:term_id>
      <wp:tag_slug>tag-3</wp:tag_slug>
      <wp:tag_name><![CDATA[Tag 3]]></wp:tag_name>
    </wp:tag>

    <wp:term>
      <wp:term_id>52</wp:term_id>
      <wp:term_taxonomy>author</wp:term_taxonomy>
      <wp:term_slug>author1</wp:term_slug>
      <wp:term_parent></wp:term_parent>
      <wp:term_name><![CDATA[author 1]]></wp:term_name>
    </wp:term>
    <wp:term>
      <wp:term_id>51</wp:term_id>
      <wp:term_taxonomy>author</wp:term_taxonomy>
      <wp:term_slug>author2</wp:term_slug>
      <wp:term_parent></wp:term_parent>
      <wp:term_name><![CDATA[author 2]]></wp:term_name>
    </wp:term>
    <wp:term>
      <wp:term_id>79</wp:term_id>
      <wp:term_taxonomy>author</wp:term_taxonomy>
      <wp:term_slug>author3</wp:term_slug>
      <wp:term_parent></wp:term_parent>
      <wp:term_name><![CDATA[author 3]]></wp:term_name>
    </wp:term>


    <generator>http://wordpress.org/?v=4.3.2</generator>


    <item>
      <title>Article 1</title>
      <link>http://www.sampleblog.com/2015/07/09/article-1/</link>
      <pubDate>Wed, 09 Jul 2015 14:27:13 +0000</pubDate>
      <dc:creator><![CDATA[mvodicka]]></dc:creator>
      <guid isPermaLink="false">http://www.sampleblog.com/?p=389</guid>
      <description></description>
      <content:encoded>
        <![CDATA[In a<a href="http://www.xyz.gov/#!documentDetail;D=CDA-2016-P-2000-0001"> animal petition</a>,

This is article 1 and contain:
<ul><li>list item 1;</li></ul><ul> <li>List item 2</li></ul><ul>     <li>List item 3.</li></ul>
Check for more updates.]]>
      </content:encoded>
      <excerpt:encoded><![CDATA[]]></excerpt:encoded>
      <wp:post_id>389</wp:post_id>
      <wp:post_date>2015-07-09 10:27:13</wp:post_date>
      <wp:post_date_gmt>2015-07-09 14:27:13</wp:post_date_gmt>
      <wp:comment_status>closed</wp:comment_status>
      <wp:ping_status>closed</wp:ping_status>
      <wp:post_name>article-1</wp:post_name>
      <wp:status>publish</wp:status>
      <wp:post_parent>0</wp:post_parent>
      <wp:menu_order>0</wp:menu_order>
      <wp:post_type>post</wp:post_type>
      <wp:post_password></wp:post_password>
      <wp:is_sticky>0</wp:is_sticky>
      <category domain="author" nicename="author2"><![CDATA[Author 2]]></category>
      <category domain="post_tag" nicename="tag-1"><![CDATA[Tag 1]]></category>
      <category domain="category" nicename="category1"><![CDATA[Category 1]]></category>
      <category domain="post_tag" nicename="tag-2"><![CDATA[Tag 2]]></category>
      <category domain="post_tag" nicename="tag-3"><![CDATA[Tag 3]]></category>
      <wp:postmeta>
        <wp:meta_key>_edit_last</wp:meta_key>
        <wp:meta_value><![CDATA[1774]]></wp:meta_value>
      </wp:postmeta>
    </item>
    <item>
      <title>Article 2</title>
      <link>http://www.sampleblog.com/2015/07/10/article-2/</link>
      <pubDate>Wed, 10 Jul 2015 14:27:13 +0000</pubDate>
      <dc:creator><![CDATA[mvodicka]]></dc:creator>
      <guid isPermaLink="false">http://www.sampleblog.com/?p=390</guid>
      <description></description>
      <content:encoded>
        <![CDATA[In a<a href="http://www.xyz.gov/#!documentDetail;D=CDA-2016-P-2000-0001"> animal society</a>,

This is article 2 and contain:
<ul><li>list item a;</li></ul><ul> <li>List item b</li></ul><ul>     <li>List item c.</li></ul>
Check for more updates.]]>
      </content:encoded>
      <excerpt:encoded><![CDATA[]]></excerpt:encoded>
      <wp:post_id>390</wp:post_id>
      <wp:post_date>2015-07-10 10:27:13</wp:post_date>
      <wp:post_date_gmt>2015-07-10 14:27:13</wp:post_date_gmt>
      <wp:comment_status>closed</wp:comment_status>
      <wp:ping_status>closed</wp:ping_status>
      <wp:post_name>article-2</wp:post_name>
      <wp:status>publish</wp:status>
      <wp:post_parent>0</wp:post_parent>
      <wp:menu_order>0</wp:menu_order>
      <wp:post_type>post</wp:post_type>
      <wp:post_password></wp:post_password>
      <wp:is_sticky>0</wp:is_sticky>
      <category domain="author" nicename="author1"><![CDATA[author 1]]></category>
      <category domain="category" nicename="category2"><![CDATA[Category 2]]></category>
      <category domain="post_tag" nicename="tag-1"><![CDATA[Tag 2]]></category>
      <category domain="post_tag" nicename="tag-3"><![CDATA[Tag 3]]></category>
      <wp:postmeta>
        <wp:meta_key>_edit_last</wp:meta_key>
        <wp:meta_value><![CDATA[1774]]></wp:meta_value>
      </wp:postmeta>
    </item>
  </channel>
</rss>


Let’s analyze this XML file.

This XML file is in WordPress format.

This XML file is categories into various parts as
  • Basic Details
  • Authors
  • Categories
  • Tags
  • Terms
  • Blog articles as an items

Basic Details


The first part provide basic details about blog like title, link, description, publish date of this blog site, blog language version etc as 

    <title>My Sample Blog</title>
    <link>http://www.sampleblog.com</link>
    <description></description>
    <pubDate>Tue, 16 Nov 2016 18:56:42 +0000</pubDate>
    <language>en-US</language>
    <wp:wxr_version>1.2</wp:wxr_version>
    <wp:base_site_url>http://engage.lexblog.com/</wp:base_site_url>
    <wp:base_blog_url>http://www.sampleblog.com</wp:base_blog_url>

Authors


Next part provides authors details which include id, login name, email, display name, first and last name as
<wp:author>
  <wp:author_id>1774</wp:author_id>
  <wp:author_login>author1</wp:author_login>
  <wp:author_email>Manoj.Gupta@sampleblog.com</wp:author_email>
  <wp:author_display_name><![CDATA[Manoj B. Gupta]]></wp:author_display_name>
  <wp:author_first_name><![CDATA[Manoj]]></wp:author_first_name>
  <wp:author_last_name><![CDATA[Gupta]]></wp:author_last_name>
</wp:author>

Categories


After that categories section which include id, nick name and category name as
<wp:category>
  <wp:term_id>45</wp:term_id>
  <wp:category_nicename>category1</wp:category_nicename>
  <wp:category_parent></wp:category_parent>
  <wp:cat_name><![CDATA[Category 1]]></wp:cat_name>
</wp:category>

Tags


Next part is related which tags which include id, name and slug name as
<wp:tag>
  <wp:term_id>41</wp:term_id>
  <wp:tag_slug>tag-1</wp:tag_slug>
  <wp:tag_name><![CDATA[Tag 1]]></wp:tag_name>
</wp:tag>

Terms


Next section is related which terms which include id, taxonomy name, parent term, slug name and name as
<wp:term>
  <wp:term_id>52</wp:term_id>
  <wp:term_taxonomy>author</wp:term_taxonomy>
  <wp:term_slug>author1</wp:term_slug>
  <wp:term_parent></wp:term_parent>
  <wp:term_name><![CDATA[author 1]]></wp:term_name>
</wp:term>

Item


Following this our main section is presnt i.e. individual blog items which include details information about article details like title, link, publish date, permanent link, content, id, post date, post type, authors for this article, categories of this article, tags associated with article etc. 

<item>
  <title>Article 1</title>
  <link>http://www.sampleblog.com/2015/07/10/article-2/</link> 
  <pubDate>Wed, 09 Jul 2015 14:27:13 +0000</pubDate>
  <dc:creator><![CDATA[author2]]></dc:creator>
  <guid isPermaLink="false">http://www.sampleblog.com/?p=389</guid>
  <description></description>
  <content:encoded>
    <![CDATA[In a<a href="http://www.xyz.gov/#!documentDetail;D=CDA-2016-P-2000-0001"> animal petition</a>,

    This is article 1 and contain:
    <ul><li>list item 1;</li></ul><ul>   <li>List item 2</li></ul><ul>     <li>List item 3.</li></ul>
    Check for more updates.]]>
  </content:encoded>
  <excerpt:encoded><![CDATA[]]></excerpt:encoded>
  <wp:post_id>389</wp:post_id>
  <wp:post_date>2015-07-09 10:27:13</wp:post_date>
  <wp:post_date_gmt>2015-07-09 14:27:13</wp:post_date_gmt>
  <wp:comment_status>closed</wp:comment_status>
  <wp:ping_status>closed</wp:ping_status>
  <wp:post_name>article-1</wp:post_name>
  <wp:status>publish</wp:status>
  <wp:post_parent>0</wp:post_parent>
  <wp:menu_order>0</wp:menu_order>
  <wp:post_type>post</wp:post_type>
  <wp:post_password></wp:post_password>
  <wp:is_sticky>0</wp:is_sticky>
  <category domain="author" nicename="author2"><![CDATA[Author 2]]></category>
  <category domain="post_tag" nicename="tag-1"><![CDATA[Tag 1]]></category>
  <category domain="category" nicename="category1"><![CDATA[Category 1]]></category>
  <category domain="post_tag" nicename="tag-2"><![CDATA[Tag 2]]></category>
  <category domain="post_tag" nicename="tag-3"><![CDATA[Tag 3]]></category>
  <wp:postmeta>
    <wp:meta_key>_edit_last</wp:meta_key>
    <wp:meta_value><![CDATA[1774]]></wp:meta_value>
  </wp:postmeta>
</item>



That’s it for the part I. In next part I will walk through with our strategy for moving this LexBlog Site into SQL Server and Sitecore.

I hope you like this Sitecore lesson. Stay tuned for more Sitecore related articles.

Till that happy sitecoring :)

Please leave your comments or share this article if it’s useful for you. 

No comments:

Post a Comment