# upgrade=true attribute

The upgrade=true attribute upgrades a database that was created using an earlier version of Derby to the current version of Derby, then connects to it.

If the database does not exist, an error appears in the error log and the connection attempt fails with an SQLException indicating that the database cannot be found.

This operation performs a full upgrade, as defined in "Upgrading a database" in the Derby Developer's Guide. For more information about upgrades, see the other topics under "Upgrades" in the Derby Developer's Guide.

For a database for which authentication and SQL authorization are both enabled, only the database owner can perform a full upgrade. See "Configuring user authentication" and "Configuring user authorization" in the Derby Security Guide for more information.

Note: You cannot perform a full upgrade on a database already booted in soft upgrade mode. If a database is already booted in soft upgrade mode, the upgrade=true attribute will have no effect. If a database is already booted in soft upgrade mode, you can first shutdown the database with the shutdown=true attribute and then connect with upgrade=true to perform the upgrade.

## Combining with other attributes

You must specify a databaseName (after the subprotocol in the database connection URL) or a databaseName=nameofDatabase attribute with this attribute.

You cannot combine this attribute with the collation or territory=ll_CC attributes.

## Examples

    jdbc:derby:sampleDB;upgrade=true

    jdbc:derby:;databaseName=sampleDB;upgrade=true;

Parent topic: Setting attributes for the database connection URL