I don't know a whole lot about WordPress and how it uses the database, but in theory this should be possible as long as you are talking about syncing the schema changes. If you are also trying to sync the data, then Liquibase is not the right tool for the job.
To do this with Liquibase, try installing using the installer and working through some of the examples to get an idea for how the tool works. The examples use a local h2 in-memory database, so it is pretty painless to try things and start over if you mess things up.
After getting a feel for things, you will want to use the Liquibase generateChangeLog
command to create the initial changelog that contains all the instructions for creating the schema as it exists on the database you are using when you run generateChangeLog
. Then test that you can run liquibase update
on a separate database and have WordPress use that database successfully.
Once you have proven that workflow, you can continue by following this pattern:
- Before making changes to the WordPress schema, run
liquibase snapshot
to create a JSON formatted snapshot of the "DEV" schema - the schema you are changing in development mode. You will need additional options to generate the JSON format snapshot.
- Make the desired changes to the WordPress "DEV" schema, most likely by using the WordPress app itself.
- Use
liquibase diffChangeLog
to compare the JSON snapshot to the newly-altered "DEV" schema. This will add changesets to the existing changelog file that describe how to alter the schema to create the desired changes.
- Use
liquibase changeLogsSync
on the "DEV" schema to update the liquibase tracking tables so that liquibase knows that the changes in the changelog already exist in that database.
- Use
liquibase update
against the "PROD" database to have the new schema changes show up in that environment.
This workflow is described in the Liquibase docs for the snapshot command.
ps - there is no d in Liquibase :-)