views:

16

answers:

1

Hi.

I have a web application with some data in its datastore. I have just finished another version of it, in which i changed one of the persistent classes. Basically, there is a class called "Node" (which represents a node in a hierarchy tree), that used to have it's author as a

private CmsUser author;

and now it stores its author as private Key author.

When i deployed that second version to the server (as another version), it didnt work (which is predictable).

Is there any way to make it work? Or do i have to create another entity instead of the Node thing and write a piece of code that would change all my old nodes into new ones?

Thanks.

+2  A: 

You will have to write some code that loads each Node in its old form, then saves it in the new form.

Since it looks like you are using java, you can do this with the low level API. If you were using Python, there is a trick you can do with Expando. See here

You might want to try the new Mapper API to handle looping through all your entities.

Peter Recore