Provide XML migration between different schemas

Description

We cannot afford to always lose the complete profiles / environments / configurations just because we change something in the underlying schema. Even though up until now we said we don't provide any kind of backwards compatibility, I strongly suggest now that we do (at least for the configuration). This is the central definition of everything and people put a lot of effort into it. To throw it away just because you do an upgrade will lead to a high frustration.

Environment

None

Gliffy Diagrams

Activity

Show:

Technical UserNovember 4, 2016 at 8:18 AM

SUCCESS: Integrated in

inspectIT - Integration #213
INSPECTIT-2113: Support for schema backward compatibility and XML (patrice.bouillet: ccc3c44e9b66034e144da6b8b9d1c459dcab65a0)

  • (edit) inspectit.server/src/main/external-resources/ci/profiles/common/struts.xml

  • (edit) inspectit.server/src/main/external-resources/ci/profiles/common/jta.xml

  • (edit) inspectit.server/src/main/external-resources/ci/schema/ciSchema.xsd

  • (edit) inspectit.server/src/main/java/rocks/inspectit/server/ci/ConfigurationInterfacePathResolver.java

  • (edit) inspectit.server/src/main/external-resources/ci/profiles/common/ejb_v2.xml

  • (edit) inspectit.server/src/main/external-resources/ci/profiles/common/webservice.xml

  • (edit) inspectit.server/src/main/external-resources/ci/profiles/common/logging-log4j.xml

  • (edit) inspectit.server/src/main/external-resources/ci/profiles/common/websocket.xml

  • (edit) inspectit.server/src/main/external-resources/ci/profiles/common/jpa.xml

  • (add) inspectit.shared.cs/src/main/java/rocks/inspectit/shared/cs/jaxb/ISchemaVersionAware.java

  • (edit) inspectit.shared.cs/src/main/java/rocks/inspectit/shared/cs/jaxb/JAXBTransformator.java

  • (edit) inspectit.server/src/main/external-resources/ci/profiles/common/hibernate.xml

  • (edit) inspectit.server/src/main/external-resources/ci/profiles/common/exclude-classes.xml

  • (edit) inspectit.server/src/main/external-resources/ci/profiles/common/ejb_v3.xml

  • (add) inspectit.shared.cs/src/main/java/rocks/inspectit/shared/cs/jaxb/AbstractSchemaVersionAware.java

  • (edit) inspectit.server/src/main/external-resources/ci/profiles/common/trinidad.xml

  • (edit) inspectit.shared.cs/src/main/java/rocks/inspectit/shared/cs/ci/BusinessContextDefinition.java

  • (add) inspectit.server/src/main/external-resources/ci/schema/migration/0001-add-schema-version-attribute.xml

  • (edit) inspectit.server/src/main/external-resources/ci/profiles/common/jsf.xml

  • (edit) inspectit.server/src/main/java/rocks/inspectit/server/ci/ConfigurationInterfaceManager.java

  • (edit) inspectit.server/src/main/external-resources/ci/profiles/common/sql.xml

  • (edit) inspectit.server/src/main/external-resources/ci/profiles/common/sql-parameters.xml

  • (edit) inspectit.server/src/main/external-resources/ci/profiles/common/http.xml

  • (edit) inspectit.shared.cs/src/main/java/rocks/inspectit/shared/cs/ci/AbstractCiData.java

  • (edit) inspectit.shared.cs/src/main/java/rocks/inspectit/shared/cs/ci/AgentMappings.java

Ivan SenicSeptember 15, 2016 at 8:43 AM

Agreed between and :

  • Keep the schema version in the XML

  • Try to migrate every file before loading, meaning check always if the version in file is fitting the current schema version (not sure where we keep schema version)

  • Read version from XML (and schema) by hand

  • First migration would be to add schema version to all XMLs

Ivan SenicSeptember 5, 2016 at 4:26 PM

Also small discussion..

Ivan SenicSeptember 5, 2016 at 9:39 AM

Very good suggestion, seams more than reasonable. I am thinking if we need some kind of README.md file in these migration folders so that people would know how to migrate or if Confluence page would be enough.

Patrice BouilletAugust 22, 2016 at 11:25 AM
Edited

Just a small comment on your description (and without looking into the PR right now): could we rename the files to a pattern like:
XXXX-describe_the_change.xml

The XXXX stands for the number and must be 4 letters long: 0001, 0002 etc. With this, it will never get mixed up like 1.xml 11.xml etc. which sometimes leads to a wrong sorting. Furthermore, after the dash, describe in some short words the changes that are applied. The pattern here is the same as the one flyway (a database migration tool) enforces and which I pretty like.

Fixed

Details

Assignee

Reporter

Integrator

Sprint

Fix versions

Affects versions

Priority

Created June 10, 2016 at 5:43 AM
Updated November 4, 2016 at 8:19 AM
Resolved November 4, 2016 at 8:19 AM