leeand00
leeand00

Reputation: 26392

Creating a database changelog xml file from an existing database (including stored procs) using Liquibase

Is it possible to create an initial database changelog xml file from the existing state of the database?

I believe I've generated the schema using generateChangeLog, but it doesn't seem to return the stored procedures (or the data).

I'm using SQL Sever 2008

Upvotes: 1

Views: 7394

Answers (3)

Noyal
Noyal

Reputation: 243

download liquibase.jar , database driver and save to one directory (Ex:/home/mySystem/liquibase), in the command line change the directory to (/home/mySystem/liquibase) and run the below mentioned command

java -jar liquibase.jar --driver=org.postgresql.Driver --classpath=postgresql-42.1.3.jar --changeLogFile=db.changelog.xml --url="jdbc:postgresql://localhost:5432/<databasename>" --username=<username> --password=<password> update

Reference link:

http://www.liquibase.org/documentation/generating_changelogs.html

Upvotes: 2

Nathan Voxland
Nathan Voxland

Reputation: 15763

You can return the data using a diffTypes flag that includes "DATA". See http://www.liquibase.org/documentation/diff.html.

Liquibase cannot currently output stored procedures, however. For that you will need to use a different tool and include them in the generated changelog using the tag.

Upvotes: 3

Nightscape
Nightscape

Reputation: 494

I just yesterday discovered SQL Power Architect, which seems to be able to generate Liquibase configurations: http://www.sqlpower.ca/page/architect

For more info on this combination see this blog post: http://blog.mgm-tp.com/2010/11/data-modeling-part2/

Upvotes: 0

Related Questions