Migrate SQL database to new server and version?

brant.felix8 years ago

I have a Traccar 3.2 server using SQL Express 2014 (windows install) and built a fresh Traccar 3.5 server also on a fresh SQL Express 2014 with a fresh (blank database. Both the 3.2 and 3.5 are working, I just need the data migrated.

Is there any documentation or steps on migrating the data from 3.2 database into 3.5 database for SQL? Can I just backup the 3.2 data from SQL and restore into the 3.5 database? I am wondering because I see many Tables and Fields have changed.

Anton Tananaev8 years ago

You need to update to 3.3 first and then to 3.5. Traccar will automatically update the database structure.

brant.felix8 years ago

This is what I get. Upgrade from 3.2 to 3.3 when well, but when I move to 3.5 I get this in the wrapper log.

INFO   | jvm 1    | 2016/05/15 11:00:09 | INFO 5/15/16 11:00 AM: liquibase: C:/Program Files (x86)/Traccar/data/changelog-3.5.xml::changelog-3.5::author: Successfully released change log lock
INFO   | jvm 1    | 2016/05/15 11:00:09 | WrapperSimpleApp: 
INFO   | jvm 1    | 2016/05/15 11:00:09 | WrapperSimpleApp Error: Encountered an error running main:
INFO   | jvm 1    | 2016/05/15 11:00:09 | WrapperSimpleApp Error: liquibase.exception.MigrationFailedException: Migration failed for change set C:/Program Files (x86)/Traccar/data/changelog-3.5.xml::changelog-3.5::author:
INFO   | jvm 1    | 2016/05/15 11:00:09 | WrapperSimpleApp Error:      Reason: liquibase.exception.DatabaseException: Foreign key 'fk_user_group_userid' references invalid table 'dbo.users'. [Failed SQL: ALTER TABLE [dbo].[user_group] ADD CONSTRAINT [fk_user_group_userid] FOREIGN KEY ([userid]) REFERENCES [dbo].[users] ([id]) ON DELETE CASCADE]
INFO   | jvm 1    | 2016/05/15 11:00:09 | WrapperSimpleApp Error: 	at liquibase.changelog.ChangeSet.execute(ChangeSet.java:590)
INFO   | jvm 1    | 2016/05/15 11:00:09 | WrapperSimpleApp Error: 	at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:51)
INFO   | jvm 1    | 2016/05/15 11:00:09 | WrapperSimpleApp Error: 	at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:73)
INFO   | jvm 1    | 2016/05/15 11:00:09 | WrapperSimpleApp Error: 	at liquibase.Liquibase.update(Liquibase.java:212)
INFO   | jvm 1    | 2016/05/15 11:00:09 | WrapperSimpleApp Error: 	at liquibase.Liquibase.update(Liquibase.java:192)
INFO   | jvm 1    | 2016/05/15 11:00:09 | WrapperSimpleApp Error: 	at liquibase.Liquibase.update(Liquibase.java:188)
INFO   | jvm 1    | 2016/05/15 11:00:09 | WrapperSimpleApp Error: 	at org.traccar.database.DataManager.initDatabaseSchema(DataManager.java:268)
INFO   | jvm 1    | 2016/05/15 11:00:09 | WrapperSimpleApp Error: 	at org.traccar.database.DataManager.<init>(DataManager.java:75)
INFO   | jvm 1    | 2016/05/15 11:00:09 | WrapperSimpleApp Error: 	at org.traccar.Context.init(Context.java:121)
INFO   | jvm 1    | 2016/05/15 11:00:09 | WrapperSimpleApp Error: 	at org.traccar.Main.main(Main.java:29)
INFO   | jvm 1    | 2016/05/15 11:00:09 | WrapperSimpleApp Error: 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
INFO   | jvm 1    | 2016/05/15 11:00:09 | WrapperSimpleApp Error: 	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
INFO   | jvm 1    | 2016/05/15 11:00:09 | WrapperSimpleApp Error: 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
INFO   | jvm 1    | 2016/05/15 11:00:09 | WrapperSimpleApp Error: 	at java.lang.reflect.Method.invoke(Unknown Source)
INFO   | jvm 1    | 2016/05/15 11:00:09 | WrapperSimpleApp Error: 	at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:325)
INFO   | jvm 1    | 2016/05/15 11:00:09 | WrapperSimpleApp Error: 	at java.lang.Thread.run(Unknown Source)
INFO   | jvm 1    | 2016/05/15 11:00:09 | WrapperSimpleApp Error: Caused by: liquibase.exception.DatabaseException: Foreign key 'fk_user_group_userid' references invalid table 'dbo.users'. [Failed SQL: ALTER TABLE [dbo].[user_group] ADD CONSTRAINT [fk_user_group_userid] FOREIGN KEY ([userid]) REFERENCES [dbo].[users] ([id]) ON DELETE CASCADE]
INFO   | jvm 1    | 2016/05/15 11:00:09 | WrapperSimpleApp Error: 	at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:301)
INFO   | jvm 1    | 2016/05/15 11:00:09 | WrapperSimpleApp Error: 	at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:55)
INFO   | jvm 1    | 2016/05/15 11:00:09 | WrapperSimpleApp Error: 	at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:107)
INFO   | jvm 1    | 2016/05/15 11:00:09 | WrapperSimpleApp Error: 	at liquibase.database.AbstractJdbcDatabase.execute(AbstractJdbcDatabase.java:1251)
INFO   | jvm 1    | 2016/05/15 11:00:09 | WrapperSimpleApp Error: 	at liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1234)
INFO   | jvm 1    | 2016/05/15 11:00:09 | WrapperSimpleApp Error: 	at liquibase.changelog.ChangeSet.execute(ChangeSet.java:554)
INFO   | jvm 1    | 2016/05/15 11:00:09 | WrapperSimpleApp Error: 	... 15 more
INFO   | jvm 1    | 2016/05/15 11:00:09 | WrapperSimpleApp Error: Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Foreign key 'fk_user_group_userid' references invalid table 'dbo.users'.
INFO   | jvm 1    | 2016/05/15 11:00:09 | WrapperSimpleApp Error: 	at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:217)
INFO   | jvm 1    | 2016/05/15 11:00:09 | WrapperSimpleApp Error: 	at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1635)
INFO   | jvm 1    | 2016/05/15 11:00:09 | WrapperSimpleApp Error: 	at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(SQLServerStatement.java:865)
INFO   | jvm 1    | 2016/05/15 11:00:09 | WrapperSimpleApp Error: 	at com.microsoft.sqlserver.jdbc.SQLServerStatement$StmtExecCmd.doExecute(SQLServerStatement.java:762)
INFO   | jvm 1    | 2016/05/15 11:00:09 | WrapperSimpleApp Error: 	at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:6276)
INFO   | jvm 1    | 2016/05/15 11:00:09 | WrapperSimpleApp Error: 	at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1793)
INFO   | jvm 1    | 2016/05/15 11:00:09 | WrapperSimpleApp Error: 	at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:184)
INFO   | jvm 1    | 2016/05/15 11:00:09 | WrapperSimpleApp Error: 	at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:159)
INFO   | jvm 1    | 2016/05/15 11:00:09 | WrapperSimpleApp Error: 	at com.microsoft.sqlserver.jdbc.SQLServerStatement.execute(SQLServerStatement.java:735)
INFO   | jvm 1    | 2016/05/15 11:00:09 | WrapperSimpleApp Error: 	at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:299)
INFO   | jvm 1    | 2016/05/15 11:00:09 | WrapperSimpleApp Error: 	... 20 more
STATUS | wrapper  | 2016/05/15 11:00:11 | <-- Wrapper Stopped
brant.felix8 years ago

Additionally, If I create a blank database, version 3.5 setup and and starts without error. This is happening by restoring the 3.3 version database to the new server. I hope that mad sense.

brant.felix8 years ago

As a test, I tried renaming the tables device to devices and user to users and now Traccar starts and seems normal. I can see my devices listed, but I don't have any history or nothing plotting on the map.

I am lost.

Anton Tananaev8 years ago

Looks like database migration doesn't work properly for MS SQL. I guess you need to do it manually. You can check changelogs to see what changed since 3.2:

https://github.com/tananaev/traccar/tree/v3.3/database
https://github.com/tananaev/traccar/tree/master/database

brant.felix8 years ago

So I tried to even get Traccar running on a fresh install. I don't know why but I cannot get SQL configuration to work right at all.

Am I wrong to follow these instructions?
http://traccar.litvak.su/installation.html

By default just connecting to SQL creates the tables and sets up the database but most of the web interface features just don't work - missing data. I have to be missing something?

this is the config I ended up with:

<?xml version='1.0' encoding='UTF-8'?>

<!DOCTYPE properties SYSTEM 'http://java.sun.com/dtd/properties.dtd'>

<properties>

    <!-- SERVER CONFIG -->

    <entry key='web.enable'>true</entry>
    <entry key='web.port'>80</entry>
    <entry key='web.path'>C:\Program Files (x86)\Traccar\web</entry>

    <entry key='geocoder.enable'>true</entry>
    <entry key='geocoder.type'>google</entry>

    <entry key='logger.enable'>true</entry>
    <entry key='logger.level'>all</entry>
    <entry key='logger.file'>C:\Program Files (x86)\Traccar\logs\tracker-server.log</entry>

    <!-- DATABASE CONFIG -->

    <entry key='database.driverFile'>C:\Program Files (x86)\Traccar\lib\sqljdbc42.jar</entry>
    <entry key='database.driver'>com.microsoft.sqlserver.jdbc.SQLServerDriver</entry>
    <entry key='database.url'>jdbc:sqlserver://Server-GPS01\GPS;database=Traccar</entry>
    <entry key='database.user'>sa</entry>
    <entry key='database.password'>********</entry>

    <entry key='database.changelog'>C:\Program Files (x86)\Traccar\data\changelog-master.xml</entry>

    <entry key='database.selectServers'>
        SELECT * FROM server;
    </entry>

    <entry key='database.updateServer'>
        UPDATE server SET
        registration = :registration,
        readonly = :readonly,
        map = :map,
        bingKey = :bingKey,
        mapUrl = :mapUrl,
        distanceUnit = :distanceUnit,
        speedUnit = :speedUnit,
        latitude = :latitude,
        longitude = :longitude,
        zoom = :zoom,
        twelveHourFormat = :twelveHourFormat
        WHERE id = :id;
    </entry>

    <entry key='database.loginUser'>
        SELECT * FROM users
        WHERE email = :email;
    </entry>

    <entry key='database.selectUser'>
        SELECT * FROM users
        WHERE id = :id;
    </entry>

    <entry key='database.selectUsersAll'>
     SELECT id, login AS name, email, readOnly AS readonly, admin FROM users;
    </entry>

    <entry key='database.insertUser'>
        INSERT INTO users (name, email, hashedPassword, salt, admin, map, distanceUnit, speedUnit, latitude, longitude, zoom, twelveHourFormat)
        VALUES (:name, :email, :hashedPassword, :salt, :admin, :map, :distanceUnit, :speedUnit, :latitude, :longitude, :zoom, :twelveHourFormat);
    </entry>

    <entry key='database.updateUser'>
        UPDATE users SET
        name = :name,
        email = :email,
        admin = :admin,
        map = :map,
        distanceUnit = :distanceUnit,
        speedUnit = :speedUnit,
        latitude = :latitude,
        longitude = :longitude,
        zoom = :zoom,
        twelveHourFormat = :twelveHourFormat
        WHERE id = :id;
    </entry>

    <entry key='database.updateUserPassword'>
        UPDATE users SET hashedPassword = :hashedPassword, salt = :salt WHERE id = :id;
    </entry>

    <entry key='database.deleteUser'>
        DELETE FROM users WHERE id = :id;
    </entry>

    <entry key='database.selectDevicePermissions'>
        SELECT u.id AS userId, d.id AS deviceId FROM users u, devices d WHERE u.admin=1
        UNION
        SELECT ud.users_id AS userId, ud.devices_id AS deviceId FROM users_devices ud
        INNER JOIN users u ON ud.users_id=u.id
        WHERE u.admin=0 AND u.readOnly=0
    </entry>

    <entry key='database.selectGroupPermissions'>
        SELECT userId, groupId FROM user_group;
    </entry>

    <entry key='database.selectDevicesAll'>
        SELECT * FROM devices;
    </entry>

    <entry key='database.insertDevice'>
        INSERT INTO devices (name, uniqueId, groupId) VALUES (:name, :uniqueId, :groupId);
    </entry>

    <entry key='database.updateDevice'>
        UPDATE devices SET name = :name, uniqueId = :uniqueId, groupId = :groupId WHERE id = :id;
    </entry>

    <entry key='database.updateDeviceStatus'>
        UPDATE devices SET status = :status, lastUpdate = :lastUpdate WHERE id = :id;
    </entry>

    <entry key='database.deleteDevice'>
        DELETE FROM devices WHERE id = :id;
    </entry>

    <!-- entry key='database.linkDevice'>
        INSERT INTO user_device (userId, deviceId) VALUES (:userId, :deviceId);
    </entry -->

    <entry key='database.unlinkDevice'>
        DELETE FROM user_device WHERE userId = :userId AND deviceId = :deviceId;
    </entry>

    <entry key='database.selectGroupsAll'>
        SELECT * FROM groups;
    </entry>

    <entry key='database.insertGroup'>
        INSERT INTO groups (name) VALUES (:name);
    </entry>

    <entry key='database.updateGroup'>
        UPDATE groups SET name = :name, groupId = :groupId WHERE id = :id;
    </entry>

    <entry key='database.deleteGroup'>
        DELETE FROM groups WHERE id = :id;
    </entry>

    <entry key='database.linkGroup'>
        INSERT INTO user_group (userId, groupId) VALUES (:userId, :groupId);
    </entry>

    <entry key='database.unlinkGroup'>
        DELETE FROM user_group WHERE userId = :userId AND groupId = :groupId;
    </entry>

    <entry key='database.selectPositions'>
        SELECT * FROM positions WHERE deviceId = :deviceId AND fixTime BETWEEN :from AND :to ORDER BY fixTime;
    </entry>

    <entry key='database.insertPosition'>
        INSERT INTO positions (device_id, protocol, serverTime, time, valid, latitude, longitude, altitude, speed, course, address, other)
        VALUES (:deviceId, :protocol, :now, :deviceTime, :valid, :latitude, :longitude, :altitude, :speed, :course, :address, :attributes);
    </entry>

    <entry key='database.selectLatestPositions'>
        SELECT id, protocol, device_id AS deviceId, serverTime, time AS deviceTime, time AS fixTime, 
        valid, latitude, longitude, altitude, speed, course, address, other AS attributes 
        FROM positions WHERE id IN (SELECT latestPosition_id FROM devices);
    </entry>

    <entry key='database.updateLatestPosition'>
        UPDATE devices SET latestPosition_id = :id WHERE id = :deviceId;
    </entry>

The Log:

2016-05-19 17:35:54  INFO: Operating system name: Windows Server 2012 R2 version: 6.3 architecture: amd64
2016-05-19 17:35:54  INFO: Java runtime name: Java HotSpot(TM) 64-Bit Server VM vendor: Oracle Corporation version: 25.91-b14
2016-05-19 17:35:54  INFO: Memory limit heap: 455mb non-heap: 0mb
2016-05-19 17:35:54  INFO: Character encoding: UTF-8 charset: UTF-8
2016-05-19 17:35:54  INFO: Version: 3.5-SNAPSHOT

Wrapper Log:

STATUS | wrapper  | 2016/05/19 17:36:26 | --> Wrapper Started as Service
STATUS | wrapper  | 2016/05/19 17:36:26 | Java Service Wrapper Community Edition 64-bit 3.5.28
STATUS | wrapper  | 2016/05/19 17:36:26 |   Copyright (C) 1999-2016 Tanuki Software, Ltd. All Rights Reserved.
STATUS | wrapper  | 2016/05/19 17:36:26 |     http://wrapper.tanukisoftware.com
STATUS | wrapper  | 2016/05/19 17:36:26 | 
STATUS | wrapper  | 2016/05/19 17:36:27 | Launching a JVM...
INFO   | jvm 1    | 2016/05/19 17:36:27 | WrapperManager: Initializing...
INFO   | jvm 1    | 2016/05/19 17:36:27 | [MLog-Init-Reporter] INFO com.mchange.v2.log.MLog - MLog clients using slf4j logging.
INFO   | jvm 1    | 2016/05/19 17:36:27 | [WrapperSimpleAppMain] INFO com.mchange.v2.c3p0.C3P0Registry - Initializing c3p0-0.9.5.2 [built 08-December-2015 22:06:04 -0800; debug? true; trace: 10]
INFO   | jvm 1    | 2016/05/19 17:36:28 | INFO 5/19/16 5:36 PM: liquibase: Clearing database change log checksums
INFO   | jvm 1    | 2016/05/19 17:36:28 | INFO 5/19/16 5:36 PM: liquibase: Successfully acquired change log lock
INFO   | jvm 1    | 2016/05/19 17:36:28 | INFO 5/19/16 5:36 PM: liquibase: Successfully released change log lock
INFO   | jvm 1    | 2016/05/19 17:36:28 | INFO 5/19/16 5:36 PM: liquibase: Successfully acquired change log lock
INFO   | jvm 1    | 2016/05/19 17:36:29 | INFO 5/19/16 5:36 PM: liquibase: Reading from [dbo].[DATABASECHANGELOG]
INFO   | jvm 1    | 2016/05/19 17:36:29 | INFO 5/19/16 5:36 PM: liquibase: Reading from [dbo].[DATABASECHANGELOG]
INFO   | jvm 1    | 2016/05/19 17:36:29 | INFO 5/19/16 5:36 PM: liquibase: C:/Program Files (x86)/Traccar/data/changelog-master.xml: C:/Program Files (x86)/Traccar/data/changelog-3.5.xml::changelog-3.5::author: Table groups created
INFO   | jvm 1    | 2016/05/19 17:36:29 | INFO 5/19/16 5:36 PM: liquibase: C:/Program Files (x86)/Traccar/data/changelog-master.xml: C:/Program Files (x86)/Traccar/data/changelog-3.5.xml::changelog-3.5::author: Table user_group created
INFO   | jvm 1    | 2016/05/19 17:36:29 | INFO 5/19/16 5:36 PM: liquibase: C:/Program Files (x86)/Traccar/data/changelog-master.xml: C:/Program Files (x86)/Traccar/data/changelog-3.5.xml::changelog-3.5::author: Foreign key constraint added to user_group (userid)
INFO   | jvm 1    | 2016/05/19 17:36:29 | INFO 5/19/16 5:36 PM: liquibase: C:/Program Files (x86)/Traccar/data/changelog-master.xml: C:/Program Files (x86)/Traccar/data/changelog-3.5.xml::changelog-3.5::author: Foreign key constraint added to user_group (groupid)
INFO   | jvm 1    | 2016/05/19 17:36:29 | INFO 5/19/16 5:36 PM: liquibase: C:/Program Files (x86)/Traccar/data/changelog-master.xml: C:/Program Files (x86)/Traccar/data/changelog-3.5.xml::changelog-3.5::author: Columns groupid(INT) added to devices
INFO   | jvm 1    | 2016/05/19 17:36:29 | SEVERE 5/19/16 5:36 PM: liquibase: C:/Program Files (x86)/Traccar/data/changelog-master.xml: C:/Program Files (x86)/Traccar/data/changelog-3.5.xml::changelog-3.5::author: Change Set C:/Program Files (x86)/Traccar/data/changelog-3.5.xml::changelog-3.5::author failed.  Error: The object 'DF_users_language' is dependent on column 'language'. [Failed SQL: ALTER TABLE [dbo].[users] DROP COLUMN [language]]
INFO   | jvm 1    | 2016/05/19 17:36:29 | liquibase.exception.DatabaseException: The object 'DF_users_language' is dependent on column 'language'. [Failed SQL: ALTER TABLE [dbo].[users] DROP COLUMN [language]]
INFO   | jvm 1    | 2016/05/19 17:36:29 | 	at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:301)
INFO   | jvm 1    | 2016/05/19 17:36:29 | 	at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:55)
INFO   | jvm 1    | 2016/05/19 17:36:29 | 	at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:107)
INFO   | jvm 1    | 2016/05/19 17:36:29 | 	at liquibase.database.AbstractJdbcDatabase.execute(AbstractJdbcDatabase.java:1251)
INFO   | jvm 1    | 2016/05/19 17:36:29 | 	at liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1234)
INFO   | jvm 1    | 2016/05/19 17:36:29 | 	at liquibase.changelog.ChangeSet.execute(ChangeSet.java:554)
INFO   | jvm 1    | 2016/05/19 17:36:29 | 	at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:51)
INFO   | jvm 1    | 2016/05/19 17:36:29 | 	at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:73)
INFO   | jvm 1    | 2016/05/19 17:36:29 | 	at liquibase.Liquibase.update(Liquibase.java:212)
INFO   | jvm 1    | 2016/05/19 17:36:29 | 	at liquibase.Liquibase.update(Liquibase.java:192)
INFO   | jvm 1    | 2016/05/19 17:36:29 | 	at liquibase.Liquibase.update(Liquibase.java:188)
INFO   | jvm 1    | 2016/05/19 17:36:29 | 	at org.traccar.database.DataManager.initDatabaseSchema(DataManager.java:268)
INFO   | jvm 1    | 2016/05/19 17:36:29 | 	at org.traccar.database.DataManager.<init>(DataManager.java:75)
INFO   | jvm 1    | 2016/05/19 17:36:29 | 	at org.traccar.Context.init(Context.java:121)
INFO   | jvm 1    | 2016/05/19 17:36:29 | 	at org.traccar.Main.main(Main.java:29)
INFO   | jvm 1    | 2016/05/19 17:36:29 | 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
INFO   | jvm 1    | 2016/05/19 17:36:29 | 	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
INFO   | jvm 1    | 2016/05/19 17:36:29 | 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
INFO   | jvm 1    | 2016/05/19 17:36:29 | 	at java.lang.reflect.Method.invoke(Unknown Source)
INFO   | jvm 1    | 2016/05/19 17:36:29 | 	at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:325)
INFO   | jvm 1    | 2016/05/19 17:36:29 | 	at java.lang.Thread.run(Unknown Source)
INFO   | jvm 1    | 2016/05/19 17:36:29 | Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The object 'DF_users_language' is dependent on column 'language'.
INFO   | jvm 1    | 2016/05/19 17:36:29 | 	at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:217)
INFO   | jvm 1    | 2016/05/19 17:36:29 | 	at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1635)
INFO   | jvm 1    | 2016/05/19 17:36:29 | 	at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(SQLServerStatement.java:865)
INFO   | jvm 1    | 2016/05/19 17:36:29 | 	at com.microsoft.sqlserver.jdbc.SQLServerStatement$StmtExecCmd.doExecute(SQLServerStatement.java:762)
INFO   | jvm 1    | 2016/05/19 17:36:29 | 	at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:6276)
INFO   | jvm 1    | 2016/05/19 17:36:29 | 	at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1793)
INFO   | jvm 1    | 2016/05/19 17:36:29 | 	at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:184)
INFO   | jvm 1    | 2016/05/19 17:36:29 | 	at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:159)
INFO   | jvm 1    | 2016/05/19 17:36:29 | 	at com.microsoft.sqlserver.jdbc.SQLServerStatement.execute(SQLServerStatement.java:735)
INFO   | jvm 1    | 2016/05/19 17:36:29 | 	at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:299)
INFO   | jvm 1    | 2016/05/19 17:36:29 | 	... 20 more
INFO   | jvm 1    | 2016/05/19 17:36:29 | INFO 5/19/16 5:36 PM: liquibase: C:/Program Files (x86)/Traccar/data/changelog-3.5.xml::changelog-3.5::author: Successfully released change log lock
INFO   | jvm 1    | 2016/05/19 17:36:29 | WrapperSimpleApp: 
INFO   | jvm 1    | 2016/05/19 17:36:29 | WrapperSimpleApp Error: Encountered an error running main:
INFO   | jvm 1    | 2016/05/19 17:36:29 | WrapperSimpleApp Error: liquibase.exception.MigrationFailedException: Migration failed for change set C:/Program Files (x86)/Traccar/data/changelog-3.5.xml::changelog-3.5::author:
INFO   | jvm 1    | 2016/05/19 17:36:29 | WrapperSimpleApp Error:      Reason: liquibase.exception.DatabaseException: The object 'DF_users_language' is dependent on column 'language'. [Failed SQL: ALTER TABLE [dbo].[users] DROP COLUMN [language]]
INFO   | jvm 1    | 2016/05/19 17:36:29 | WrapperSimpleApp Error: 	at liquibase.changelog.ChangeSet.execute(ChangeSet.java:590)
INFO   | jvm 1    | 2016/05/19 17:36:29 | WrapperSimpleApp Error: 	at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:51)
INFO   | jvm 1    | 2016/05/19 17:36:29 | WrapperSimpleApp Error: 	at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:73)
INFO   | jvm 1    | 2016/05/19 17:36:29 | WrapperSimpleApp Error: 	at liquibase.Liquibase.update(Liquibase.java:212)
INFO   | jvm 1    | 2016/05/19 17:36:29 | WrapperSimpleApp Error: 	at liquibase.Liquibase.update(Liquibase.java:192)
INFO   | jvm 1    | 2016/05/19 17:36:29 | WrapperSimpleApp Error: 	at liquibase.Liquibase.update(Liquibase.java:188)
INFO   | jvm 1    | 2016/05/19 17:36:29 | WrapperSimpleApp Error: 	at org.traccar.database.DataManager.initDatabaseSchema(DataManager.java:268)
INFO   | jvm 1    | 2016/05/19 17:36:29 | WrapperSimpleApp Error: 	at org.traccar.database.DataManager.<init>(DataManager.java:75)
INFO   | jvm 1    | 2016/05/19 17:36:29 | WrapperSimpleApp Error: 	at org.traccar.Context.init(Context.java:121)
INFO   | jvm 1    | 2016/05/19 17:36:29 | WrapperSimpleApp Error: 	at org.traccar.Main.main(Main.java:29)
INFO   | jvm 1    | 2016/05/19 17:36:29 | WrapperSimpleApp Error: 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
INFO   | jvm 1    | 2016/05/19 17:36:29 | WrapperSimpleApp Error: 	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
INFO   | jvm 1    | 2016/05/19 17:36:29 | WrapperSimpleApp Error: 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
INFO   | jvm 1    | 2016/05/19 17:36:29 | WrapperSimpleApp Error: 	at java.lang.reflect.Method.invoke(Unknown Source)
INFO   | jvm 1    | 2016/05/19 17:36:29 | WrapperSimpleApp Error: 	at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:325)
INFO   | jvm 1    | 2016/05/19 17:36:29 | WrapperSimpleApp Error: 	at java.lang.Thread.run(Unknown Source)
INFO   | jvm 1    | 2016/05/19 17:36:29 | WrapperSimpleApp Error: Caused by: liquibase.exception.DatabaseException: The object 'DF_users_language' is dependent on column 'language'. [Failed SQL: ALTER TABLE [dbo].[users] DROP COLUMN [language]]
INFO   | jvm 1    | 2016/05/19 17:36:29 | WrapperSimpleApp Error: 	at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:301)
INFO   | jvm 1    | 2016/05/19 17:36:29 | WrapperSimpleApp Error: 	at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:55)
INFO   | jvm 1    | 2016/05/19 17:36:29 | WrapperSimpleApp Error: 	at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:107)
INFO   | jvm 1    | 2016/05/19 17:36:29 | WrapperSimpleApp Error: 	at liquibase.database.AbstractJdbcDatabase.execute(AbstractJdbcDatabase.java:1251)
INFO   | jvm 1    | 2016/05/19 17:36:29 | WrapperSimpleApp Error: 	at liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1234)
INFO   | jvm 1    | 2016/05/19 17:36:29 | WrapperSimpleApp Error: 	at liquibase.changelog.ChangeSet.execute(ChangeSet.java:554)
INFO   | jvm 1    | 2016/05/19 17:36:29 | WrapperSimpleApp Error: 	... 15 more
INFO   | jvm 1    | 2016/05/19 17:36:29 | WrapperSimpleApp Error: Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The object 'DF_users_language' is dependent on column 'language'.
INFO   | jvm 1    | 2016/05/19 17:36:29 | WrapperSimpleApp Error: 	at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:217)
INFO   | jvm 1    | 2016/05/19 17:36:29 | WrapperSimpleApp Error: 	at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1635)
INFO   | jvm 1    | 2016/05/19 17:36:29 | WrapperSimpleApp Error: 	at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(SQLServerStatement.java:865)
INFO   | jvm 1    | 2016/05/19 17:36:29 | WrapperSimpleApp Error: 	at com.microsoft.sqlserver.jdbc.SQLServerStatement$StmtExecCmd.doExecute(SQLServerStatement.java:762)
INFO   | jvm 1    | 2016/05/19 17:36:29 | WrapperSimpleApp Error: 	at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:6276)
INFO   | jvm 1    | 2016/05/19 17:36:29 | WrapperSimpleApp Error: 	at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1793)
INFO   | jvm 1    | 2016/05/19 17:36:29 | WrapperSimpleApp Error: 	at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:184)
INFO   | jvm 1    | 2016/05/19 17:36:29 | WrapperSimpleApp Error: 	at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:159)
INFO   | jvm 1    | 2016/05/19 17:36:29 | WrapperSimpleApp Error: 	at com.microsoft.sqlserver.jdbc.SQLServerStatement.execute(SQLServerStatement.java:735)
INFO   | jvm 1    | 2016/05/19 17:36:29 | WrapperSimpleApp Error: 	at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:299)
INFO   | jvm 1    | 2016/05/19 17:36:29 | WrapperSimpleApp Error: 	... 20 more
STATUS | wrapper  | 2016/05/19 17:36:32 | <-- Wrapper Stopped
Anton Tananaev8 years ago

The link that you mention is not for official Traccar project.

As for the error, the issue has been already fixed in the code. You need to take latest database changelog files from GitHub.

brant.felix8 years ago
Anton Tananaev8 years ago

Take all of them. I don't remember which one I have fixed.

Collins3 years ago

Hi anton i am trying to setup sql database and i keep getting the following error

 ERROR: HikariPool-1 - Exception during pool initialization. - The server selected protocol version TLS10 is not accepted by client preferences [TLS13, TLS12] - SSLHandshakeException (... < DataManager:130 < *:89 < Context:290 < Main:120 < ...)
 ERROR: Main method error - The server selected protocol version TLS10 is not accepted by client preferences [TLS13, TLS12] - SSLHandshakeException (... < DataManager:130 < *:89 < Context:290 < Main:120 < ...)
 WARN: JNA: Callback org.traccar.WindowsService$ServiceMain@928763c threw the following exception - The server selected protocol version TLS10 is not accepted by client preferences [TLS13, TLS12] - SSLHandshakeException (... < DataManager:130 < *:89 < Context:290 < Main:120 < ...)

i have even changed the registry to as follows:

"C:\Program Files\Traccar\jre\bin\java.exe" -Dhttps.protocols=TLSv1.2 -Duser.dir="C:\Program Files\Traccar" -jar "C:\Program Files\Traccar\tracker-server.jar" --service ".\conf\traccar.xml"

My config file is as follows

<entry key='database.driver'>com.microsoft.sqlserver.jdbc.SQLServerDriver</entry>
<entry key='database.url'>jdbc:sqlserver://DESKTOP-PSHDIV6\RANCELAB2008;user=admin;password=#####;databaseName=Traccar;</entry>
<entry key='database.user'>admin</entry>
<entry key='database.password'>#####</entry>

what could be the issue?

Anton Tananaev3 years ago

Looks like your SQL server is using outdated protocol. Maybe you can disable TLS encryption?