Ramblings about Umbraco, .net and JavaScript development. With a sprinkle of other stuff.

Copying Umbraco datatype settings (prevalues).

I had to copy a grid with settings and our "default template" settings today. Given there's no copy datatype feature in Umbraco yet, I had the option of ticking all the boxes manually, or invent a quicker way. So I ended up just doing a quick hack in SQL to do the work for me. I'm mostly putting it here for my own reference for later, but maybe - just maybe it's useful for you too. :)

If you create a new datatype with the same property editor in the backoffice, you can compare it's settings with an existing one as such:

Just swap out 1038 and 1630 with your respective source values.
If you run the query you'll see that we'd like the values on the right to be copied to the left ones. That's just a matter of running and update. Wrap it in a transaction just to check that you don't update 1000 prevalues inadvertently: