org.h2.dev.util
Class Migrate
java.lang.Object
org.h2.dev.util.Migrate
public class Migrate
- extends java.lang.Object
Migrate a H2 database version 1.1.x (page store not enabled) to 1.2.x (page
store format). This will download the H2 jar file version 1.2.127 from
maven.org if it doesn't exist, execute the Script tool (using Runtime.exec)
to create a backup.sql script, rename the old database file to *.backup,
created a new database (using the H2 jar file in the class path) using the
Script tool, and then delete the backup.sql file. Most utility methods are
copied from h2/src/tools/org/h2/build/BuildBase.java.
Method Summary |
void |
execute(java.io.File file,
boolean recursive,
java.lang.String user,
java.lang.String password,
boolean runQuiet)
Migrate a database. |
static void |
main(java.lang.String... args)
Migrate databases. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Migrate
public Migrate()
main
public static void main(java.lang.String... args)
throws java.lang.Exception
- Migrate databases. The user name and password are both "sa".
- Parameters:
args
- the path (default is the current directory)
- Throws:
java.lang.Exception
- if conversion fails
execute
public void execute(java.io.File file,
boolean recursive,
java.lang.String user,
java.lang.String password,
boolean runQuiet)
throws java.lang.Exception
- Migrate a database.
- Parameters:
file
- the database file (must end with .data.db) or directoryrecursive
- if the file parameter is in fact a directory (in which
case the directory is scanned recursively)user
- the user name of the databasepassword
- the passwordrunQuiet
- to run in quiet mode
- Throws:
java.lang.Exception
- if conversion fails