Upgrade liquibase

I have several projects that have been using liquibase 3.6.3 or other 3.x variant for multiple years. Some of these projects have dozens or hundreds of executed chagnesets.

I’d like to upgrade these projects to liquibase 4.x. Before I get started I’m curious the philosophy of how later versions of liquibase handle older changeset files. My instance tells me to never change an old changeset xml file, but those xml documents are using older xml schema definition like

<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
        http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.3.xsd"

    logicalFilePath="db/changelog/db-changelog-1.0.xml">

Should I be able to leave all those files untouched using the old xml schema and namespace and only new changeset files use the new 4.x? Do I need to go change hundreds of xml files to change their namespace and re-calculate checksums on each DB? What’s the recommended way to handle upgrades after changesets are already live and still have the ability to standup a test DB from scratch using the changesets?

Thanks

Hi @brant ,

That is a rally good question. I suppose our development team could be able answer your question accurately. @NathanVoxland @MikeOlivas do you mind taking a moment to answer this query. Thank you :slight_smile:

Hi @brant, I think I can answer your question at least partly as we upgraded from a 3.x version of Liquibase to 4.x recently.

Basically the answer is that you should be able to safely change the xsd version in your existing .xml files without it causing any issues when running Liquibase on existing databases.

The reason for this is that the databaseChangeLog part of the xml files is not included when calculating the checksum, so changing the xsd version does not change the checksum.

Obviously that does still mean that you’d need to change every existing xml file. I can’t really say for sure if you could potentially leave the old xsd version in your existing xml files as it would depend on exactly which 4.x version you upgrade to and what the differences are between the xsd specifications for the 3.x version you’re currently using and the 4.x version you plan to upgrade to.

When we did our upgrade we just went ahead and changed all of our existing xml files so that we could be sure there would be no compatibility issues.

Hope that helps.

Cheers,
Dave