1

We are doing content migration want to create tool using below approach please give your valuable suggestions.

Developing this tool there is huge in items and many items are modified but not published after adding latest changes so in that case old version item content is on published page.

In that case we don't want to use content port and want to publish the correct version item to keep in sync.

Check components and pages for last modified and last published to live time stamp.

If last published date is less than the last modified time of the item then marking it as a draft item.

take one previous version of the item and compare it's last modified date with last published timestamp. If last modified date is less than published date then want to revert back this version of item.

Revert back items to its correct previous version by creating a newer version of the item modified timestamp changes and has to be pick.

Planning to create tool using core service please let me know which API to use.

0

There is no direct API available to achieve what you are looking for.

Given below are the steps that I would recommend:

  1. Loop through the structured group / folder and get the pages / components. The reason to loop through folder / structured group is: we have noticed when there are large no of items there potential chances of query timeout.
  2. Loop through pages / components and retrieve last published information and version history.
return client.GetListXml("<Structured group id / folder id>", new OrganizationalItemItemsFilterData
            {
                ItemTypes = new[] { ItemType.Page },
                Recursive = false,
                BaseColumns = ListBaseColumns.Default
            });
  1. Go through version history comparison to find out the matching version.
VersionsFilterData versionsFilter = new VersionsFilterData();
IdentifiableObjectData[] versionList = client.GetList("<Item Id>", versionsFilter );
  1. Once version is identified then roll forward to that version.

There is one scenario which you will have consider while performing above steps, i.e. what if page had 10 versions and 8th version was published and someone deleted that version then the roll forward version will not match with what you have in site. For these cases, I would recommend manually checking the output from version.

Update based on further question There are two approaches to get the published version.

  1. Start with current version of the item, check date for it and compare it with published date. If it is less than or equal to published date then current version is published. If that is not the case then continue by reducing version no and checking date for it and comparing again with published date. Continue this process until the version that is published is reached.
  2. At the publish time, write event system to capture the version of the item being published. That way you always have the version that is published and you don't need to calculate it.
| improve this answer | |
  • Want to know which version of items was published how to find out it please provide your inputs – k951 Sep 22 '15 at 5:26
  • Updated answer with details. – Hiren Kaku Sep 22 '15 at 5:33
  • If this is what you were looking for then can you please accept it as an answer. – Hiren Kaku Sep 22 '15 at 14:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.