Skip to content

Instantly share code, notes, and snippets.

@arafalov
Created June 15, 2012 19:22
Show Gist options
  • Save arafalov/2938303 to your computer and use it in GitHub Desktop.
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
// 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