Retrieving Content History

Topics: General
Feb 10, 2012 at 8:40 PM

I notice, from browsing the database, that Orchard stores each successive version of a given content piece.  For example, if I make a post that says "Hey World!" and I change it to "Hello World!", the database keeps both versions of that post.

This implies there is some kind of history-viewing capability, or the ability to restore an older version of a post.  But I have not yet noticed what dashboard command or option provides access to such history.  Is that a pending feature?

Feb 10, 2012 at 9:04 PM

Basically it's implemented in the Draft / Publish / Unpublish functionality of content, but you can also install the Version Manager module for complete control over all revisions of your content.

Feb 10, 2012 at 9:49 PM
Edited Feb 10, 2012 at 9:50 PM

Does orchard automatically store all versions of all content parts, or do you have to declare something in Migrations.cs to tell Orchard to version a particular part/type? 

And how do you access the history for an item through the UI? Do you need Version Manager module? 

Feb 11, 2012 at 4:16 AM

It only versions parts where the record inherits from ContentPartVersionRecord. In your migration you can say .ContentPartVersionRecord() instead of .ContentPartRecord(). You can upgrade old parts just by adding a ContentItemRecord_id field.

Yes you need Version Manager to view full history.