Sitecore remove previous versions on duplicating or copying item

Hi all,

When duplicating or copying an item in Sitecore, all the versions are copied to the new item as well. Sometimes this is unwanted behaviour, especially when the first version of the item was not part of the workflow. When you publish the item, the latest published state would be published (i.e. the non-workflow version)

A simple trick is to remove the previous versions of the item when duplicating or copying item. This is done by intercepting the uiCopyItems and uiDuplicateItem.
Note that for uiDuplicateItem, the Sitecore.Buckets.config aborts the pipeline before the original duplicate pipeline. To avoid this, we make sure our custom pipeline is triggered first before the bucket config.

Custom config patch:


Sitecore.buckets.config:
Then we have a Sitecore extension helper to remove the previous versions:
DuplicateItem class:
CopyItem class:
And that's it. Note that I applied this to Sitecore 7.2 Update 5

HTH,
Andreas

45 comments

I wish to show thanks to you just for bailing me out of this particular trouble.As a result of checking through the net and meeting techniques that were not productive, I thought my life was done.
Digital Marketing Training in Chennai

Digital Marketing Training in Bangalore
Digital Marketing Training in Pune

Reply

All the points you described so beautiful. Every time i read your i blog and i am so surprised that how you can write so well.
Click here:
python training institute in chennai
Click here:
python training in chennai

Reply

It's interesting that many of the bloggers to helped clarify a few things for me as well as giving.Most of ideas can be nice content.The people to give them a good shake to get your point and across the command

Blueprism training in Chennai

Blueprism training in Bangalore

Blueprism training in Pune

Reply

Awesome..You have clearly explained …Its very useful for me to know about new things..Keep on blogging..

Data Science Training in Chennai
Data science training in bangalore
Data science online training
Data science training in pune

Reply

Nice tips. Very innovative... Your post shows all your effort and great experience towards your work Your Information is Great if mastered very well.
java online training | java training in pune

java training in chennai | java training in bangalore

Reply

You made such an interesting piece to read, giving every subject enlightenment for us to gain knowledge. Thanks for sharing the such information with us

angularjs Training in chennai
angularjs-Training in pune

angularjs-Training in chennai

angularjs Training in chennai

angularjs-Training in tambaram

Reply

I likable the posts and offbeat format you've got here! I’d wish many thanks for sharing your expertise and also the time it took to post!!
angularjs Training in bangalore

angularjs Training in btm

angularjs Training in electronic-city

angularjs online Training

angularjs Training in marathahalli

Reply

Thank you so much for sharing such an amazing blog. Visit for
Website Development Company in Delhi

Reply

I am really enjoying reading your well-written articles. It looks like you spend a lot of effort and time on your blog. I have bookmarked it and I am looking forward to reading new articles. Keep up the good work.
Hadoop course in Marathahalli Bangalore
DevOps course in Marathahalli Bangalore
Blockchain course in Marathahalli Bangalore
Python course in Marathahalli Bangalore
Power Bi course in Marathahalli Bangalore

Reply

Superb. I really enjoyed very much with this article here. Really it is an amazing article I had ever read. I hope it will help a lot for all. Thank you so much for this amazing posts and please keep update like this excellent article. thank you for sharing such a great blog with us.
python training in velachery | python training institute in chennai

Reply

Good job in presenting the correct content with the clear explanation. The content looks real with valid information. Good Work

DevOps is currently a popular model currently organizations all over the world moving towards to it. Your post gave a clear idea about knowing the DevOps model and its importance.

Good to learn about DevOps at this time.


devops training in chennai | devops training in chennai with placement | devops training in chennai omr | devops training in velachery | devops training in chennai tambaram | devops institutes in chennai | devops certification in chennai

Reply

I am reading your post from the beginning, it was so interesting to read & I feel thanks to you for posting such a good blog, keep updates regularly.
SEO Training Institute in Chennai
SEO training course
Best SEO training in chennai
Digital Marketing Training
Digital marketing training institute in chennai
Digital marketing classes in chennai

Reply

Do you mind if I quote a couple of your posts as long as I provide credit and sources back to your blog? My blog is in the same niche as yours
nebosh course in chennai

Reply

Wonderful post. Thanks for taking time to share this information with us.

Article submission sites
Guest posting sites

Reply

Very nice post. I definitely appreciate this site. Thanks for sharing...visit for
web development company in noida

Reply


بسم الله الرحمن الرحيم نحن فى شركة الكمال نقوم بجميع خدمات نقل العفش والاساس بافض الطرق تحت اشراف

فريق كبير مدرب على اعلى مستوى من المستويات مع الفك والتركيب
شركة نقل اثاث بالطائف
شركة نقل اثاث بجازان
شركة نقل اثاث بحائل
شركة نقل اثاث ونقل عفش بحائل
والسلامة عليكم ورحمة الله وبركاته

Reply

Outstanding blog thanks for sharing such wonderful blog with us ,after long time came across such knowlegeble blog. keep sharing such informative blog with us.

machine learning classroom training in chennai
python machine learning training in chennai
machine learning training in velachery
top institutes for machine learning in chennai

Reply

Inspiring writings and I greatly admired what you have to say , I hope you continue to provide new ideas for us all and greetings success always for you..Keep update more information..
Microsoft Azure online training
Selenium online training
Java online training
Java Script online training
Share Point online training

Reply

Thank you for this post. Thats all I are able to say. You most absolutely have built this blog website into something speciel. You clearly know what you are working on, youve insured so many corners.thanks
devops online training

aws online training

data science with python online training

data science online training

rpa online training

Reply

Such an great and nice blog, Thank you for sharing this wonderful post.


ExcelR Data Science Course in Bangalore

Reply

Nice information, valuable and excellent design, as share good stuff with good ideas and concepts, lots of great information and inspiration, both of which I need, thanks to offer such a helpful information here.
ExcelR Data science courses in Bangalore

Reply

Hi buddies, it is great written piece entirely defined, continue the good work constantly.
Data Science Course in Pune

Reply

i am for the first time here. I found this board and I in finding It truly helpful & it helped me out a lot. I hope to present something back and help others such as you helped me.
data science course malaysia

Reply

I was just browsing through the internet looking for some information and came across your blog. I am impressed by the information that you have on this blog. It shows how well you understand this subject. Bookmarked this page, will come back for more.
data science course in singapore

Reply

Attend The Digital Marketing courses in bangalore From ExcelR. Practical Digital Marketing courses in bangalore Sessions With Assured Placement Support From Experienced Faculty. ExcelR Offers The Digital Marketing courses in bangalore.
Digital Marketing Courses in Bangalore

Reply


Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I’ll be subscribing to your feed and I hope you post again soon.
Great post, Thanks for sharing.

Reply

Great Article… I love to read your articles because your writing style is too good, its is very very helpful for all of us

You will get an introduction to the Python programming language and understand the importance of it. How to download and work with Python along with all the basics of Anaconda will be taught. You will also get a clear idea of downloading the various Python libraries and how to use them.
Topics
About ExcelR Solutions and Innodatatics
Do's and Don’ts as a participant
Introduction to Python
Installation of Anaconda Python
Difference between Python2 and Python3
Python Environment
Operators
Identifiers
Exception Handling (Error Handling)
Excelr Solutions

Reply

I like viewing web sites which comprehend the price of delivering the excellent useful resource free of charge. I truly adored reading your posting. Thank you!
data analytics course malaysia

Reply

Awesome blog. I enjoyed reading your articles. This is truly a great read for me. I have bookmarked it and I am looking forward to reading new articles. Keep up the good work!
data analytics course malaysia

Reply


Really very happy to say,your post is very interesting to read.I never stop myself to say something about it.You’re doing a great job.Keep it up.
One data science
One Machine Learning

Reply


Really very happy to say,your post is very interesting to read.I never stop myself to say something about it.You’re doing a great job.Keep it up.
One data science
One Machine Learning

Reply

Awesome post sir,
really appreciate for your writing. This blog is very much useful...
Hi guyz click here Digital Marketing Training in Bangalore to get the best knowledge and details and also 100% job assistance hurry up...!!

DO NOT MISS THE CHANCE...

Reply

Post a Comment