Switch dbType from Nvarchar to Ntext without data loss
On one of my Umbraco installs, I'd like to switch a data-type from using the old Tree Multi Picker control to the uComponents MultiNode Tree Picker control. The problem I have is that I originally set the underlying dbType to Nvarchar - and I know that MNTP uses Ntext to store the data/value.
Quick test of this shows that the data/value doesn't persist across Nvarchar and Ntext ... so the question is how to best do this?
I did find an old forum topic about this, but there was no real solution - aside from "hacking around in the database tables". I could easily do this myself - but I'm hoping that there's a more elegant answer out there ... even if it means that we need to create a new package/dashboard-control for it.
Any ideas, suggestions? (Hoping there's a package out there that already does this)
Following up on my own topic... I ended up doing a SQL UPDATE on the cmsPropertyData table:
UPDATE
cmsPropertyData
SET
dataNtext = dataNvarchar
FROM
cmsPropertyData AS d
INNER JOIN
cmsPropertyType AS t ON t.id = d.propertytypeid
WHERE
d.dataNvarchar IS NOT NULL
AND
d.dataNvarchar != ''
AND
t.Alias = 'promoNodes'
;
Didn't have time to build a nice UI for this functionality ... if any one wants to develop something like this, you're free to use this code snippet.
Switch dbType from Nvarchar to Ntext without data loss
On one of my Umbraco installs, I'd like to switch a data-type from using the old Tree Multi Picker control to the uComponents MultiNode Tree Picker control. The problem I have is that I originally set the underlying dbType to Nvarchar - and I know that MNTP uses Ntext to store the data/value.
Quick test of this shows that the data/value doesn't persist across Nvarchar and Ntext ... so the question is how to best do this?
I did find an old forum topic about this, but there was no real solution - aside from "hacking around in the database tables". I could easily do this myself - but I'm hoping that there's a more elegant answer out there ... even if it means that we need to create a new package/dashboard-control for it.
Any ideas, suggestions? (Hoping there's a package out there that already does this)
Thanks, Lee.
Following up on my own topic... I ended up doing a SQL UPDATE on the cmsPropertyData table:
Didn't have time to build a nice UI for this functionality ... if any one wants to develop something like this, you're free to use this code snippet.
Cheers, Lee.
Thanks a lot for this Lee, it got me on the right track.
is working on a reply...