17 December 2014

CoreSync - Sync Sitecore Content - Introduction - Part -1

Hi folks,

It’s been long time since I have write something exciting which made this place boring. But no worries in last few months I have been involved in many challenges which appear when you do work in multisite scenario and that too on larger scale. Next series of post is all about how I solve one of the content administration challenge.

There is challenge when your development is in momentum where dev team release the build in every 2-3 months timespan while content authors on prod or staging environment continuously pouring in content for multiple website  and for there numerous localization etc., Which make such environments too crowdy and especially when your content authors may come from different organization, stakeholders and with different skill sets.

In such case taking the content backup is a very serious business.?
-         We all know there is no content backup tool out of the box provided by Sitecore or any other provider and taking DB backup is not a proper solution, let this discuss further.

-          Usual solution is to take DB backup like 6 times a day which is automated and in event of crisis restore those backups on some other machine and then use something to get the content back, but is this only or correct solution? 
      What you do in event of data loss, where you need to recover only particular content item or section of contents in one of the website and that too for particular locale?

-          By the way I mean by something 'underlined' is to use Sitecore packaging or other tools like Razl to sync the difference from backup to target Sitecore machine. But Razl is also not automated process and don't deal in detail.

So there are challenges which make it difficult to take backup selectively and restore the content with confidence and ease.
Now let’s look this problem in detail which is divided into two parts:
First is Backup 
       Need a tool which can back up the production content.
       On demand: Tool should be able to backup as an when required apart from scheduling capability.
       Detailed backup: Tool should be able to backup site/item level backup, which includes media item too. It should also be capable of taking required language level backup of a given item too.

Second is the Restoration.
       Need a tool which can restore available backup content.
       Simple and Efficient: Team should be able to restore with minimum overhead of time and complexity.
       Detailed restoration: Tool should be able to restore required site/item level content, which includes media item too. It should also be capable of restoring only required language level content without disturbing existing content for other locales

So I guess I made the problem statement very clear. The basic solution to this problem would be move the content from one location to another in bulk. The bold statement in previous sentence required CRUD operation in Sitecore at very efficient manner which can be automated also.

Here I guess Sitecore lack this capability OOB(Oh Sorry Packaging and serialisation is still there). But there is no service or tool which can sync the content across the Sitecore environments, but I think it is deliberately. So that this space can be filled by other vendors and community.
No surprise that even TDS was there from years and Sitecore Rocks(But does Sitecoe Rocks moving content at mass in production, no it is for developers) make into day to day affairs of developers but yet Sitecore didn't release its own SOA based interface which is fully capable. Here capability means whatever you can do using Sitecore Shell in terms of CRUD operations, you should be able to do the same using services.

If you look into Sitecore ASMX service, you will be able to do the general operation but lacks the sharpness and complete capabilities, same applies on Item Web API which is new kid on block. But I like this kid.

For example Item Web API does not support to create the versioned (Language or Numbered) item. The media item support is also not great with Item Web API. The biggest support I am looking, what If, if I want to create an Item while retaining the Item ID on the new Sitecore System. Such can only happen through two ways in Sitecore one is Plain Serialization or it’s another popular derivative which is Sitecore packaging.

Now to overcome these challenges I decide to extend the Item Web API in such a manner so that it can do lot more than what it made for. Though on choosing solutions I love Razl but I can’t extend it because it is third party software.

I guess have set the context of my next series of blog post where I will write how to extend Sitecore Web API. To consume that extended Web API I had extend already available client wrapper which helps to call the JSON/XML based service using .NET objects. I thanks Nick for his contribution.

Once you have the new service and new client available then you can build any interface which can take backup and restore the same from one system to another. Another point to make this new service exciting, it should have caching capability, Security feature like Encrypting and smart way to optimize the performance which will uncover in coming blog post. Following diagram showing an automated backup and manual restoration process should work.

CoreSync - Backup/Restoration Use Case

Remember this API will also open new avenues to move the content from one system to another without using Sitecore packaging, like moving content from content editor itself or from my favorite Sitecore Powershell extensions. You know if you are able to have this feature using Powershell then you can automate it and schedule it reliably out of Sitecore. 
People who directly want to dive in the code can directly look into GitHub repo here.

No comments:

Post a Comment