Package org.h2.dev.util
Class Migrate
- java.lang.Object
-
- org.h2.dev.util.Migrate
-
public class Migrate extends java.lang.ObjectMigrate 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.
-
-
Constructor Summary
Constructors Constructor Description Migrate()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexecute(java.io.File file, boolean recursive, java.lang.String user, java.lang.String password, boolean runQuiet)Migrate a database.static voidmain(java.lang.String... args)Migrate databases.
-
-
-
Method Detail
-
main
public static void main(java.lang.String... args) throws java.lang.ExceptionMigrate 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.ExceptionMigrate 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
-
-