6
votes

I am trying to export data from an Oracle (ojdbc7) database using liquibase.

My property file has below options:

  • driver: oracle.jdbc.driver.OracleDriver
  • url: jdbc:oracle:thin:@localhost:1521:XE
  • username: user
  • password: user
  • outputChangeLogFile:src/main/resources/output.xml
  • defaultSchemaName: USERS

In STS I used below command to generate the changelog liquibase:generateChangeLog -DdiffTypes="data"

and through command prompt I used: mvn liquibase:generateChangeLog -DdiffTypes="data"

But nothing works, I got only crateTable commands not the insert queries.

Please guide.

2

2 Answers

9
votes

mvn liquibase:generateChangeLog -Dliquibase.diffTypes=data

should work

8
votes

I would suggest try to export data via CLI liquibase version. Download it here, unpack, put ojdbc7.jar into liquibase folder:

liquibase --driver=oracle.jdbc.OracleDriver \
      --classpath=\path\to\classes:ojdbc7.jar \
      --changeLogFile=db.changelog.xml \
      --url="jdbc:oracle:thin:@localhost:1521:XE" \
      --username=user \
      --password=user \
      --diffTypes="data" generateChangeLog

If everything will work fine we can move to the next step - try to migrate data via maven.