Build an automatic archiving job.


A customer of mine wants me to build an automatic archivingh job for their news-pages. When a news-page has passed it's stop published-date they want to move that page to a specific Month-folder in the three-structure (for example: If a page has it's stop published date 2011-01-24 that page should be moved to the january-container under the 2011-container in the three structure). They know that they can asign wich archive each page should be archived to themself but they want it to be all automatic.

My first thought was to asign every pages ArchiveLink dynamicly in code behind but I noticed that the ArchiveLink-property is read-only so I had to try a different approach.

Is there a way to make the ArchiveLink-property wrtiable, or do anyone here have any other good pointers on how I should resolve this task?

Jan 20, 2011 12:31

Rather than assigning the property on each page, use a property on the container (I assume that news pages are in, if not a single, just a few containers). This should pont to the root of the archive. It could also be a dynamic property.

If needed you can make your property look like the standard property (but preferably only available on containers) and hide the original archive property by using the trick Anders mentions in this forum thread:

Then of course you have to store some setting for the page type to use for the container pages, as a property on the start page/settings page, key in appSettings etc. Then create a scheduled job which finds expired pages and reads the dynamic property (or traverses the tree to find the container page's property) to get the info where to move the page. Add some logic for finding/creating the year and month containers.

Jan 20, 2011 13:09

You could do it the other way around

Every month create a new month page, and move pages to that month page.


Jan 20, 2011 13:39

automagily ofcourse :)

Jan 20, 2011 13:39

The PageArchiveLink doesn't appear to be read only? Have you tried using CreateWritableClone if you are trying to update a page property programmatically?

You could always hook into the Published event on the news page type and set the PageArchiveLink link based on the end publish date. It just needs to ensure that the archive/year/month structure exists before setting the link.

It becomes fully automatic and uses the standard archive function...

Jan 20, 2011 15:14

Alexander, at Epinova we have a custom module that does exactly what you need - archives pages into a year/month structure with a scheduled job. This module is in use in several of our production sites. It will be available shortly on epicode or codeplex, in the mean time I can send you the files you need. Email me at if you're interested!

Jan 24, 2011 8:59

Thanks for the input! You've given me a lot of good information and pointers. I'm going to try the module that Arild spoke about.

Jan 24, 2011 9:26

Hey Arlid, the module you use seems pretty cool any idea on when it will be published onto EPiCode ?



Feb 14, 2011 11:13

Minesh - send your email address to me ( and I'll send you the module. Haven't had time to upload to EPiCode.

Feb 14, 2011 11:18

For reference - the Epinova.DateTreeArchive custom archiving module I mentioned above is now available at

May 02, 2011 15:01
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.