onsdag den 12. november 2014

How to move users from Sitecore 5.3 to Sitecore 7.2

Issue

Users from a Sitecore 5 solution is needed in a new Sitecore 7.2 solution.

Solution

Two webforms are made. One to serialize users from the Sitecore 5.3 site into xml and one to import users into the Sitecore 7.2 site from the xml.

Serialization of users from Sitecore 5.3

This code iterates all users in the solution and writes it to an xmlfile in the App_Data folder. Username, Email, Fullname and roles are serialized.


onsdag den 5. november 2014

Sitecore as a Nuget-package - Buildsetup Part 1


Issue

One of our main issues when developing Sitecore solutions is to keep our sites up to date with Sitecore files.

The solution to this issue has for years been to run a custom robocopy script that copies the files from the public development server.
This requires that the server is always reachable, up to date and not infected with misplaced files.

Solution

I have made a script that takes a Sitecore zip installation file as input and creates a nuget-package from it.

This article will show how this is done.

Following steps are taken when creating the nuget-package
  1. Initializing variables
  2. Unpacking zip-file
  3. Moving data-folder to App_Data/Sitecore
  4. Creating force.txt files to force empty directories to be included in nuget-package
  5. Copy developer license file to App_Data/Sitecore/License
  6. web.config changes - Correcting paths to dataFolder and license file 
  7. Creating nuspec file - Syncronising version of Sitecore with the nuget-package
  8. Creating nuget package