Previous Topic

Next Topic

Book Contents

Book Index

Converting from One Database to Another

If you need to convert your connectDaily database from one engine to another, a program is provided to do this. For example, if you want to convert from Microsoft Access to Microsoft SQL Server, then you can use the database converter.

WARNING
DO NOT USE A DATABASE UPSIZING WIZARD OR OTHER CONVERTER. ONLY THE CONNECTDAILY CONVERTER WILL CORRECTLY CONVERT THE DATA.

Note for MS Access Conversions from 64-bit machines
If you are converting to or from Microsoft Access on a 64-bit machine, you must do the following:

If you have the 64-bit Access ODBC Drivers installed, you can use a 64-bit Java installation for the conversion.

If you do not have the 64-bit Access ODBC drivers installed, you must use a 32-bit Java installation. You also need to start 32-bit command prompt by running %WINDIR%\SysWow64\cmd.exe. You only need the 32-bit JVM for the conversion. After the conversion, you can use a 64-bit JVM to run connectDaily if desired.

Running the Conversion

  1. Get the JDBC drivers for each database. If you're converting to or from Access, the JDBC Driver is already built-in to Java.
  2. Create a configuration.properties file for each database. Refer to the appropriate manual section for your database.
  3. Run the schema creation script for the destination database.
  4. Run the converter:

    java -classpath cdaily-x.x.x/WEB-INF/lib/MHS.jar:cdaily-x.x.x/WEB-INF/lib/cdaily.jar:cdaily-x.x.x/WEB-INF/lib/JSON-java.jar:Path To Source JDBC Driver Jar:Path to Destination JDBCDriver
    com.mhsoftware.cdaily.support.db.DatabaseConverter source_configuration.properties destination_configuration.properties

    The command is one statement and should be all on one line.

    Note that path separators are ";" characters on Windows, and ":" on UNIX and Mac OS X.

    If everything is working (file paths are right, and database connection strings are right) the system will prompt you if you're sure you wish to wipe the destination database. Type "yes" and the conversion will run. If a problem is encountered, an error message will be displayed. Correct the error and re-try the conversion.

    If you want to run the conversion without confirmation add --yes as the last parameter.

Here are some common errors:

Exception in thread "main" java.lang.NoClassDefFoundError: com/mhsoftware/cdaily/support/db/DatabaseConverter - You are referencing a version of cdaily.jar that doesn't contain the Database Converter. The converter is only present in versions 3.4.16 and higher.

ClassNotFoundException - You're probably not specifying the right path to the JDBC driver jar.

SQL Exception: Invalid object (or table) name referencing 'cd_dbversion' - You didn't run the schema creation script on the destination database.

SQLException on connection - Your connection parameters are wrong.

See Also

SQL Database Setup

SQL Database Setup Overview

configuration.properties

Apache Derby Configuration

IBM DB2 Configuration

Microsoft SQL Server 2005-2019 Configuration

MySQL Installation

Oracle Configuration

PostgreSQL Configuration

Sybase Adaptive Server Anywhere Configuration