# Understanding Rollback

**URL:** <https://forum.liquibase.org/t/understanding-rollback/1245>\
**Category:** General Discussion\
**Created:** [April 26, 2011, 11:07pm UTC](https://forum.liquibase.org/t/understanding-rollback/1245 "2011-04-26T23:07:00Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![tortoise\_74](https://avatars.discourse-cdn.com/v4/letter/t/5f8ce5/32.png) [@tortoise\_74](https://forum.liquibase.org/u/tortoise_74)\
**Post date:** [April 26, 2011, 11:07pm UTC](https://forum.liquibase.org/t/understanding-rollback/1245/1 "2011-04-26T23:07:00Z")

</div>

Hi,  
&nbsp;&nbsp;&nbsp; I’m not sure that I fully understand how the rollback feature is supposed to work.  
Given a simple change log like:  
  
\<?xml version="1.0" encoding="UTF-8" standalone="no"?\>  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   
  
  
  
If I run:  
  
sh ./liquibase \<br\>&nbsp; --defaultsFile=mydb.properties \<br\>&nbsp; --changeLogFile=testlog.xml \<br\>&nbsp;rollbackSQL testlog  
  
I get an error (I get the same error using just rollbackSQL):  
  
Liquibase Home: /home/brucea/liquibase  
INFO 4/26/11 5:00 PM:liquibase: Successfully acquired change log lock  
INFO 4/26/11 5:00 PM:liquibase: Reading from DATABASECHANGELOG  
INFO 4/26/11 5:00 PM:liquibase: Successfully released change log lock  
Liquibase Update Failed: Could not find tag ‘testlog’ in the database  
SEVERE 4/26/11 5:00 PM:liquibase: Could not find tag ‘testlog’ in the database  
liquibase.exception.RollbackFailedException: Could not find tag ‘testlog’ in the database  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at liquibase.changelog.filter.AfterTagChangeSetFilter.(AfterTagChangeSetFilter.java:28)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at liquibase.Liquibase.rollback(Liquibase.java:292)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at liquibase.Liquibase.rollback(Liquibase.java:268)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at liquibase.integration.commandline.Main.doMigration(Main.java:716)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at liquibase.integration.commandline.Main.main(Main.java:116)  
  
The changelog id “testlog” is clearly there in the DATABASECHANGELOG table.  
  
I am also unclear why I should not to provide a rollback tag at all.   
The implication is that a rollback tag is not the same thing as a changeset id.  
So what is it?  
  
Regards,  
  
Bruce.

---

<div class="post-metadata">

**Author:** ![nvoxland](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@nvoxland](https://forum.liquibase.org/u/nvoxland)\
**Post date:** [April 26, 2011, 11:07pm UTC](https://forum.liquibase.org/t/understanding-rollback/1245/2 "2011-04-26T23:07:00Z")

</div>

(Missed your question originally, sorry)

The tag is created via the “liquibase tag” command, and is not connected to the ids at all.

Nathan

---

<div class="post-metadata">

**Author:** ![un1405070192687r6id](https://avatars.discourse-cdn.com/v4/letter/u/9de053/32.png) [@un1405070192687r6id](https://forum.liquibase.org/u/un1405070192687r6id)\
**Post date:** [April 26, 2011, 11:07pm UTC](https://forum.liquibase.org/t/understanding-rollback/1245/3 "2011-04-26T23:07:00Z")

</div>

Can give a example of rollback with rollback,on command,&nbsp;

thanks

---

<div class="post-metadata">

**Author:** ![un1382561729492r88id](https://avatars.discourse-cdn.com/v4/letter/u/c4cdca/32.png) [@un1382561729492r88id](https://forum.liquibase.org/u/un1382561729492r88id)\
**Post date:** [April 26, 2011, 11:07pm UTC](https://forum.liquibase.org/t/understanding-rollback/1245/4 "2011-04-26T23:07:00Z")

</div>

Here are a few resources:

The Liquibase docs on rollback have a bit about what the rollback command means when you rollback using a tag:

[http://www.liquibase.org/documentation/rollback.html](http://www.liquibase.org/documentation/rollback.html)

> ## Datical, Inc. [http://www.datical.com/](http://www.datical.com/)

---

<div class="post-metadata">

**Author:** ![un1405070192687r6id](https://avatars.discourse-cdn.com/v4/letter/u/9de053/32.png) [@un1405070192687r6id](https://forum.liquibase.org/u/un1405070192687r6id)\
**Post date:** [April 26, 2011, 11:07pm UTC](https://forum.liquibase.org/t/understanding-rollback/1245/5 "2011-04-26T23:07:00Z")

</div>

thank you very much! I think I have got it,I should define a tagDatabase. By the way, and is there a completed document of changeSet file? include insert,rollback,tagDatabase and so on. &nbsp; &nbsp;

---

<div class="post-metadata">

**Author:** ![nvoxland](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@nvoxland](https://forum.liquibase.org/u/nvoxland)\
**Post date:** [April 26, 2011, 11:07pm UTC](https://forum.liquibase.org/t/understanding-rollback/1245/6 "2011-04-26T23:07:00Z")

</div>

[http://www.liquibase.org/documentation/rollback.html](http://www.liquibase.org/documentation/rollback.html) gives some examples.&nbsp;

Tagging the database is usually done outside the changelog, like how you do a tag in git/svn/whatever.&nbsp;

If you want to automatically tag, tagDatabase is documented here: [http://www.liquibase.org/documentation/changes/tag\_database.html.](http://www.liquibase.org/documentation/changes/tag_database.html.)

Nathan
