Replace PageTypeBuilder


We are currently using PageTypeBuilder and want to replace it with EpiServer 7 built in page type support.

To avoid recreating pages on the site I am looking for a way to replace the class created in PTB with the new way, and to avoid loosing information created by the editors.

This is the tool I am using to convert classes:

Next step is to change the inheritance on the template to EpiServer.TemplatePage<T> where T is the class built with EpiServer 7 page type support.

By visiting the page this error occur:

ContentData Cast. The requested type Class is not compatible with Castle.Proxies.ClassTypeProxy

Since I change the type on the template this error seems fair. 

I am not really sure about the next step. If we look in the database (tables tblcontent and tblcontenttype) the page created in edit mode is connected to the class genereted by PTB and not my new one of course.

Do I have do modify the database in some way? or have I missed something in my steps above?

The goal here is to make sure nothing is loost when deploying our website.

All help is appreciated!

Jun 12, 2013 9:55

I have build an EPiServer 7 version of Erik Nordins tool that can be found at

Make sure that the GUID of your created page type class and the page type in the database is the same.

All your created Page Types have to inherit from PageData or a sub class that inherits PageData.

The other option is to manually edit your Page Type Builder classes and replace the Attributes with EPiServer 7 attributes instead

Edited, Jun 12, 2013 10:38

Thanks for your answer Alf. Actually I am using your tool. Added the wrong URL in the post.

I will give it a try and post the result here.

Jun 12, 2013 10:53

Marked as answered.

Used the tool to convert my classes and using the same GUID did the trick. Thanks for your answer Alf!

Jun 20, 2013 8:53
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.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.