Created
June 15, 2012 19:22
-
-
Save arafalov/2938303 to your computer and use it in GitHub Desktop.
Using Kentico site export, find all Document Aliases that have culture assigned and may not survive culture change
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Using Kentico site export, find all Document Aliases that have culture assigned and may not survive culture change | |
// Uses LINQPad's C# Statements format | |
//Root directory where the unzipped Kentico export file sit (with Data subdirectory) | |
string exportDirPath = @"<UNZIPPED_FULL_SITE_EXPORT>\Data"; | |
//XML files for documents and templates definitions | |
XDocument docSource = XDocument.Load(exportDirPath + @"\Documents\cms_document.xml.export"); | |
XDocument docAliasSource = XDocument.Load(exportDirPath + @"\Documents\cms_documentalias.xml.export"); | |
var t = | |
( | |
from alias in docAliasSource.XPathSelectElements("//cms_documentalias[AliasCulture]") | |
join | |
doc in docSource.XPathSelectElements("//NewDataSet/*") | |
on alias.Element("AliasNodeID").Value equals doc.Element("NodeID").Value | |
let aliasCulture = alias.Element("AliasCulture").Value | |
where aliasCulture != "" | |
select new { | |
AliasCulture = aliasCulture, | |
AliasURLPath = alias.Element("AliasURLPath").Value, | |
DocPath = doc.Element("DocumentNamePath").Value, | |
DocAliasCulture = doc.Element("DocumentCulture").Value | |
} | |
); | |
t.Dump("Aliases"); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment