Downgrading from v7.x to v6.x after setting valueRepresentation

Hello,

We’re currently testing out v7.x meaning we need to switch between v6.9 and v7.1 depending on what we want to test. We have set "valueRepresentation": "String" for the v7.1 config so am I right in saying that will prevent us being able to easily switch back to v6.9.0 as it just will not know how to handle that representation type as in v6.x all representation is as an object/document?

If so is it simply a case of enabling the rebuild option in the configuration and deploying?:

"rebuild": {
  "apps": true
}

I’ve just gone for a whole app rebuild but for this situation we could probably just rebuild contents, hoping it doesn’t add too much time rebuilding the whole app as a general refresh.

Any guidance would be greatly appreciated!

Well that didn’t work! Just getting loads of errors such as:

Lifecycle start canceled due to errors at stage 1000: System.FormatException: An error occurred while deserializing the Document property of class Squidex.Infrastructure.States.MongoState`1[[Squidex.Infrastructure.EventSourcing.Grains.EventConsumerState, Squidex.Infrastructure, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]: Error converting value “{“position”:“1664199999-1-0-1”,“count”:12643,“isStopped”:false,“error”:null,“isPaused”:false,“isFailed”:false}” to type ‘Squidex.Infrastructure.EventSourcing.Grains.EventConsumerState’. Path ‘’.

So is downgrading a major version not really viable? It’s fine with me as I am urging everyone to just push forward with v7.x!

The representation property will cause issues with downgrading, that’s right.

  1. Content and assets and asset folders do not need to change.
  2. EventConsumerState need to be migrated manually.
  3. Apps, rule, schemas can be rebuild with the rebuild setting.
1 Like

Just realised all this time I had assumed the string representation setting was only for contents! Now I am upset with MongoDB Compass as it doesn’t automatically copy the JSON string properties into an Object when I change the type.

Now, it is for everything except contents. I have a generic “store” class where I add things that are usually key-value representations. So I am not running any special queries on that.

To avoid the issue that to write new serializer I have leveraged JSON for these things.

Well I tried manually editing the collections to use Objects instead of String but it didn’t work after spamming rebuilds at it (think I got it into quite a bad state!) so I instead just deleted all collections and restarted the Docker container to start from scratch with v6.9.0. Fortunately our only manual steps are creating apps and assigning users so wasn’t too onerous.

For now we are holding off changing the valueRepresentation setting until we are definitely only using v7 in all environments.

The other collections aside from States_EventConsumerState I had to amend (perhaps I hadn’t specified correct rebuild options?) that I can remember were:

  • States_UsageTracker
  • States_Names
1 Like