0
votes

I have an old installation of Sitefinity (version 6.3) On the profile, I have a custom field that is numeric. I now have the needs to change this to hold a string instead.

What I found was that there is no easy way to change datatype (https://www.progress.com/documentation/sitefinity-cms/edit-an-existing-custom-field), but is It possible by code/config?

I'm guessing that one option is to delete the field, and then recreate it is a possibility, but since I have much data it would be a lot of work to restore data in the field. Is this the only way?

Edit: I've deleted the column and recreated it as a string/varchar. I'm now facing a problem with some type of converter

type converter initialization failed. The converter with name 'DecimalConverter' does not convert from CLR type 'System. String' to SQL type 'DECIMAL'.
Parameter name: converterName
Actual value was OpenAccessRuntime.Data.DecimalConverter, Telerik.OpenAccess.Runtime, Version=2013.3.1211.3, Culture=neutral, PublicKeyToken=7ce17eeaf1d59342.

This line in stack trace is of importance

[MetadataException: The metadata for field 'CustomerNo_sv' of class 'Telerik.Sitefinity.Security.Model.SitefinityProfile' cannot be initialized: Type converter initialization failed. The converter with name 'DecimalConverter' does not convert from CLR type 'System. String' to SQL type 'DECIMAL'.
Parameter name: converterName
Actual value was OpenAccessRuntime.Data.DecimalConverter, Telerik.OpenAccess.Runtime, Version=2013.3.1211.3, Culture=neutral, PublicKeyToken=7ce17eeaf1d59342.]

Somehow the language specified values isn't converted as I can see. Now the whole site is down and I can't reach backend. So I guess I have to solve this out in DB?

1

1 Answers

0
votes

What I do in similar cases is this:

I create the new field and then populate the new column in the database with the values from the old column (field).

In your case, you'd be looking at the sf_sitefinity_profile table.

This way the data will be migrated to the new field.

After that you can delete the old field and start using the new one.