I had the problem recently and got it fixed by deleting Visitor Groups before changing the code. Once you have deleted them, build, run the site again and create the Visitor Groups again.
If you have already used the Visitor Groups in content, you can find content Id with the following query (do this before deleting them):
WHERE LongString like '%VM_VisitorGroup.ExternalId%'
as content in content areas have ' data-groups="" ' attribute on when personalized.
In a dialogue with Optimizely Support, this became the best solution.
Once a Criteria and a corresponding Model is deployed and used by a Visitor Group, the references seems to be spread out over several objects in the db. So far, I have identified these:
For some reason, we need to change the namespace and/or the classnames of deployed Criterias and Models.
Currently, we are getting an error during init:
"Value cannot be null"
What is the recommended way to do this correctly?