Test data Snapshot using liquibase

we have Postgresql -cloud DB each for microservices. we are planning to take a data snapshot before processing . Is it something that can be achieved using liquibase? Any thoughts would be really helpful

HI @kathir_43 ,

Yes. There is a way to do that by setting should-snapshot-data to true. The should-snapshot-data parameter is a Boolean that allows Liquibase to snapshot your database data. The default value is false . You can have more details on this document: should-snapshot-data parameter | Liquibase Docs

Thanks @aditi for providing insights!. I have a basic knowledge on liquibase and am using Maven+Liquibase+POSTGRESQL. How can i use snapshot-data command in maven? Any documentation on this would be helpful!

I am able to take snapshot of test data using the ‘should-snapshot-data parameter’. But how to use this snapshot file for roll back . I am not using for any comparison . My requirement is to take data snapshot, then use the DB data for processing and roll back the changes to snapshot version. Is it something that can be achieved with Liquibase??@aditi

Hi @kathir_43 ,

As per my knowledge, you would not be able to rollback using snapshot. The main use of snapshot is for comparing the target DB state with the original DB state.

For rollbak you can try tagging the database when you take the snapshot and rolling back to that tag. Read more about rollback here.

Thanks,
Rakhi Agrawal

Thanks Aditi… I have used snapshot data paramter command and the generated json file doesnt have any data related tags inside. It should have some insert tags for storing data rite?