Migrating from HSQLDB on TC 5.1.5 (build 13602) to Oracle on TC 6

I am currently running Teamcity 5.1.5 WAR distribution on JBoss using the internal HSQLDB database. I also install Teamcity 6 and decided to use an external
Oracle database. So  TC 6  is running fine with all the tables created from scratch. What is the best way to migrate all the data from the TC 5.1.5 HSQLDB
database to the TC 6 Oracle database?  I have about 20 projects currently running of TC 5.1.5 so I don't want to manual migrate them to TC 6.

Secondly, I downloaded the WAR distribution of Teamcity I did not see a maintainDB.cmd/sh  script file. Where can I get this script and can I run it
from anywhere? teamcity is running on JBoss as a WAR.

18 comments
Comment actions Permalink

Paul, do you have any data in TC 6.0 installation that you would like to preserve? I am asking because our migration procedure can't merge data, you'd need to create a clean database in Oracle and import data there. Your current TC 6.0 data will be lost (however it is possible to preserve project configurations).

In brief to migrate to Oracle, first, you'll need to migrate your existing 5.1.1 installation to Oracle (using migrate command, see: http://confluence.jetbrains.net/display/TCD5/Migrating+to+an+External+Database), then you need to upgrade your installation to TeamCity 6.0. Before doing any migration make sure you have a backup.

Migrate scripts are not included into the war distribution, they are present in .exe and .tar.gz TeamCity distributions.

0
Comment actions Permalink

Pavel:
TC 6  has no data I only create a System Administrator that's it.

We are using the Teamcity 5.1.5 WAR distribution deployed on JBoss so once we migrate from the internal DB to Oracle
just point TC 6 to the newly converted Oracle schema?

Could we backup just the configurations, projects, and users from TC 5.1.5 HSQLDB and restore to TC 6 Oracle?

0
Comment actions Permalink

Then I would suggest to migrate 5.1.1 to Oracle, and then upgrade 5.1.1 to 6.0. In this case TC 6.0 will use Oracle database.

0
Comment actions Permalink

Pavel I am attempting to migrate from HSQLDB to oracle for Teamcity 5.1.5 I execute the following command:

./maintainDB.sh migrate -T /cmfciohnas01/cfs/j2ee/qa/teamcityjboss_qa/downloads/database.oracle.properties

I get the following error:
Cannot proceed with 'migrate' command: The sources database contains  data from newer TeamCity version (code version: 378, data version: 379).

Actual Output:
Command line arguments: migrate -T /cmfciohnas01/cfs/j2ee/qa/teamcityjboss_qa/downloads/database.oracle.properties
Using TeamCity data directory: /cmfciohnas01/cfs/j2ee/qa/teamcityjboss_qa/downloads/.BuildServer
Using internal database.
Using source database
        database type: HSQLDB
        database driver: org.hsqldb.jdbcDriver
        connection: jdbc:hsqldb:file:/cmfciohnas01/cfs/j2ee/qa/teamcityjboss_qa/downloads/.BuildServer/system/buildserver
        login as: <empty>
Cannot proceed with 'migrate' command: The sources database contains data from newer TeamCity version (code version: 378, data version: 379).
Please use backup procedure from corresponding TeamCity version.
Critical error has occurred during command execution.

Help! What am I doing wrong?

0
Comment actions Permalink

Correction the TeamCity version is 5.1.5 NOT 5.1.1. Anyway I was able to migrate from HSQLDB to Oracle without errors.

Then I tried to start up the TeamCity 5.1.5 server can got the following errors:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'buildServerConfigurator' defined in ServletContext resource [/WEB-INF/buildServerConfigurator.xml]: Invocation of init method failed; nested exception is java.lang.RuntimeException: Failed to load TeamCity configuration. null

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)   at java.security.AccessController.doPrivileged(Native Method)   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)   at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)   at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)   at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)   at

For more detail open the attached text file. I don't know what to do next.



Attachment(s):
server_error.txt.zip
0
Comment actions Permalink

Hello Paul,

We are investigating this error for now. Probably it is caused by Oracle specific behavior - when it returns null for the empty string. But I am not sure why we did not have this problem before, given that we have plenty of Oracle based TeamCity installations.

0
Comment actions Permalink

Pavel in your investigation please remember that the problem is occurring with TC 5.1.5 (build 13602).
The migration generated no errors and I have attached the output of the migration. I also have access to
the oracle schema and the user has full access. I am able to see all the tables generated by the migrations
so it is assumed that the tables.

Secondly, is there a way to  migrate just the projects, configurations and users from HSQLDB to Oracle?



Attachment(s):
migration_hsql_oracle_5.1.5.txt.zip
0
Comment actions Permalink

Paul, I uploaded a build from 5.1 branch with this bug fixed to our ftp:
ftp://ftp.intellij.net/pub/.teamcity/ge/

Could you please try to install it? Also some time ago I sent you email about this build.

0
Comment actions Permalink

Pavel sometime ago you sent me the link for Teamcity-6.0-EAP to test Siteminder integration. I will try to install and run this version thanks.

0
Comment actions Permalink

Paul, the same problem exists in 6.0, so it won't help. Please try the build from our ftp.

0
Comment actions Permalink

Pavel,

I was able to start the TC 5.1.5 (build 13635) server with the oracle database. I did see a SQL error in the log however:

[2010-12-20 11:30:21,158]  ERROR -   jetbrains.buildServer.SERVER - jetbrains.buildServer.serverSide.db.UnexpectedDBException: SQL error when doing: Apply parameter
SQL exception: Invalid column type jetbrains.buildServer.serverSide.db.UnexpectedDBException: SQL error when doing: Apply parameter
SQL exception: Invalid column type
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)

I have attached the log file.  I think the migration did not convert a column type properly.

When you say the same problem exists in 6.0, does this mean I should not upgrade
from TC 5.1.5 to TC 6.0?


In the logs I also noticed that pom.xml files were not being found, as shown below.

[2010-12-20 11:30:21,173]   INFO - tbrains.buildServer.ACTIVITIES - Configuration added to queue; name=Workflow :: Workflow deploy to weblogic {id=bt16}; requestor=Schedule Trigger; promotion id=11945
[2010-12-20 11:35:20,019]   WARN - impl.MavenMetadataProviderImpl - Error generating Maven metadata for build configuration MyAccounts :: MyAccounts {id=bt42}: File not found: pom.xml
[2010-12-20 11:38:39,684]   WARN - impl.MavenMetadataProviderImpl - Error generating Maven metadata for build configuration MyAccounts :: ebbc {id=bt20}: File not found: ebbc-gwt\pom.xml
[2010-12-20 11:39:20,139]   WARN - impl.MavenMetadataProviderImpl - Error generating Maven metadata for build configuration Franchise Finance :: Notification service {id=bt14}: File not found: SourceCode\notification-service\pom.xml



Attachment(s):
teamcity-server.log.zip
0
Comment actions Permalink

Pavel,
Interestingly I am getting the SQL exception when I try to do a backup as well and it does matter what options I check.

[2010-12-20 12:32:58,696]   INFO - tbrains.buildServer.ACTIVITIES - Backup settings were changed by "Paul Garvey"
[2010-12-20 12:32:59,102]  ERROR -   jetbrains.buildServer.SERVER - Error in JSP, request dump:
Path: /runtimeError.jsp
Method: POST
Param: _config.includeBuildLogs = []
Param: submitSettings = [Save Settings]
Param: config.includeConfiguration = [true]
Param: _config.includePersonalChanges = []
Param: _config.addTimestampSuffix = []
Param: config.addTimestampSuffix = [true]
Param: init = [1]
Param: config.fileName = [TeamCity_Backup]
Param: revertSettings = [Reset]
Param: _config.includeConfiguration = []
Param: _config.includeDatabase = []
jetbrains.buildServer.serverSide.db.UnexpectedDBException: SQL error when doing: Apply parameter
SQL exception: Invalid column type
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269)

Attached data directory. Please change the database.properties file to point to your Oracle schema.

0
Comment actions Permalink

Paul, what version of Oracle do you use?


0
Comment actions Permalink

10.2.0.4 is the oracle version

0
Comment actions Permalink

Paul, could you please attach or send to us a screenshot of your build queue? Also could you please check Oracle jdbc driver version, it should be higher than 10.2.0.1.0.

0
Comment actions Permalink

Pavel The oracle driver was the issue I changed it to 10.2.0.4.0 and that fixed the problems. TC 6.0 with Oracle is now up and running.
Thanks for all your help.



Attachment(s):
build_queue.png
0
Comment actions Permalink

Great, thank you for update. I think you can safely upgrade to 6.0 now.

0
Comment actions Permalink

Thanks for all you help. It's is already upgraded to 6.0 and running.

0

Please sign in to leave a comment.