0

We have a project where the database support is given for Sql Server and Oracle and to control the version on the database side we are using liquibase. Sometimes we need to bring a backup of the customer's database to our own infrastructure to investigate issues and work on it. We currently have more than 1000 changesets (and counting..) for database versioning, which takes a lot of time.

The problem: When we bring a backup from the customer and restore it into our local environment, we need to clear the DATABASECHANGELOG and re-run all the changesets again to force the liquibase calculate the correct checksum. We don't know how exactly the liquibase calculate it but we suppose it envolves environments variables like database and instance name, which is different from our customer to our own env.

Question: We would like to know, how could we improve this process? Maybe configuring how the liquibase should calculate the checksum (maybe considering just the ID, Author and Script). Or recalculate the checksum to our environment. Clearning the DATABASECHANGELOG and re-runing all the changesets is consuming a lot of time and make it difficult to maintenance.

Thank you.

Felipe Oriani
  • 37,948
  • 19
  • 131
  • 194
  • Are the customers actually changing the database or table structures? Or are you just trying to load the customer data to replicate the issue? If it's the second I'm not sure liquibase needs to be involved at all. – Zynon Putney II Aug 06 '20 at 16:44
  • The customer does not change the database, we just restore it on our environment and if we just runs the differences, it will break on the firsts changesets because of the checksum. To workaround on it, we have to clear the databasechangelot and re-run, when it works, but consume a lot of time (and sometimes, timeout problems on our devops pipeline). – Felipe Oriani Aug 06 '20 at 16:47
  • Yes, but what I'm suggesting is maybe you don't need to restore it via liquibase. Create an empty database with liquibase and then use one of the data import tools for the RDBMS you're using? Otherwise use the liquibase client to clear the checksums? https://stackoverflow.com/a/30221141/7112871 – Zynon Putney II Aug 06 '20 at 17:13
  • Let me ask, looking at this solution for `clearCheckSum` I have seen that in the next update the checksum will be generated. What is the difference of clearning the databasechangelog and doing this? – Felipe Oriani Aug 06 '20 at 18:05

0 Answers0