1) Download latest build from http://myultrashare.appspot.com/s/traccar-web/dev/latest/traccar-web.war
2) Stop Traccar service.
3) Put the downloaded traccar-web.war
in Traccar installation folder (/opt/traccar
or c:\Program Files\Traccar
). I recommend to do a backup of existing traccar-web.war
just in case.
4) Update the configuration file (located in conf\traccar.xml
of traccar installation folder):
-
add the following lines to the end of file:
<entry key='web.type'>old</entry> <entry key='web.application'>/opt/traccar/traccar-web.war</entry>
-
Replace
/opt/traccar/traccar-web.war
path with the path to your traccar installation (usually it will be the same folder on linux/mac, on windows it is most probablyc:\Program Files\Traccar\traccar-web.war
).
5) Disable notification system. Add following lines to the end of configuration file (located in conf\traccar.xml
of traccar installation folder):
<entry key='event.enable'>false</entry>
<entry key='event.overspeedHandler'>false</entry>
<entry key='event.overspeed.notRepeat'>true</entry>
<entry key='event.motionHandler'>false</entry>
<entry key='event.geofenceHandler'>false</entry>
<entry key='event.alertHandler'>false</entry>
<entry key='event.ignitionHandler'>false</entry>
<entry key='event.statusHandler'>false</entry>
<entry key='event.maintenanceHandler'>false</entry>
6) Disable database migrations made by the backend by commenting out the following configuration file entry in default configuration file (located in conf\default.xml
of traccar installation folder):
Old:
<entry key='database.changelog'>/opt/traccar/schema/changelog-master.xml</entry>
New: ( comment out or remove this entry )
<!-- <entry key='database.changelog'>/opt/traccar/schema/changelog-master.xml</entry> -->
IMPORTANT NOTE : These changes must be done in default configuration file named default.xml
, not in traccar.xml
.
IMPORTANT NOTE : Your database must be empty before first startup. To ensure this please drop and re-create the existing database:
-
for a default H2 database this can be done by removing contents of the
data
folder under the traccar installation folder. The database will be automatically re-created on first service start. -
for any other databases like MySQL there are queries to drop and create them. Also this can be done via GUI management tools (like MySQL Workbench).
IMPORTANT NOTE : This will delete all existing data. If it needed to be preserved, then instead of dropping database just use a brand new database with a different name. Then data can be copied between databases using SQL queries or some scripts.
7) Disable queries for the group permissions and attribute aliases in default configuration file (located in conf\default.xml
of traccar installation folder):
Old:
<entry key='database.selectGroupPermissions'>
SELECT userId, groupId FROM user_group
</entry>
New:
<!-- entry key='database.selectGroupPermissions'>
SELECT userId, groupId FROM user_group
</entry -->
Old:
<entry key='database.selectAttributeAliases'>
SELECT * FROM attribute_aliases
</entry>
New:
<!-- entry key='database.selectAttributeAliases'>
SELECT * FROM attribute_aliases
</entry -->
IMPORTANT NOTE : These changes must be done in default configuration file named default.xml
, not in traccar.xml
.
8) Add following queries to the end of configuration file (located in conf\traccar.xml
of traccar installation folder):
<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>
<entry key='database.ignoreUnknown'>false</entry>
<entry key='database.selectUsersAll'>
SELECT u.id, u.login AS name, u.password AS hashedPassword, u.salt, u.email, u.readOnly AS readonly,
u.expirationDate AS expirationTime, u.blocked AS disabled, u.admin,
us.speedUnit, us.centerLatitude AS latitude, us.centerLongitude AS longitude,
us.zoomLevel AS zoom
FROM users AS u
LEFT OUTER JOIN user_settings us ON us.id = u.userSettings_id
</entry>
<entry key='database.loginUser'>
SELECT u.id, u.login AS name, u.password AS hashedPassword, u.salt, u.email, u.readOnly AS readonly,
u.expirationDate AS expirationTime, u.blocked AS disabled, u.admin,
us.speedUnit, us.centerLatitude AS latitude, us.centerLongitude AS longitude,
us.zoomLevel AS zoom
FROM users AS u
LEFT OUTER JOIN user_settings AS us ON us.id = u.userSettings_id
WHERE u.email = :email
</entry>
<entry key='database.selectServers'>
SELECT s.id, s.bingMapsKey AS bingKey,
us.speedUnit, us.centerLatitude AS latitude, us.centerLongitude AS longitude,
us.zoomLevel AS zoom
FROM application_settings AS s
LEFT OUTER JOIN user_settings AS us ON us.id = s.userSettings_id
</entry>
<entry key='database.selectDevicePermissions'>
SELECT u.id AS userId, d.id AS deviceId FROM users AS u, devices AS d WHERE u.admin = 1
UNION
SELECT ud.users_id AS userId, ud.devices_id AS deviceId FROM users_devices AS ud
INNER JOIN users AS u ON ud.users_id=u.id
WHERE u.admin=0 AND u.readOnly=0
</entry>
8a) Only for the first time installation, i.e. not when upgrading from previous versions when the database is already present
Temporarily comment out the following queries in default configuration file (located in conf\default.xml
of traccar installation folder).
Old:
<entry key='database.selectDevicesAll'>
SELECT * FROM devices;
</entry>
New:
<!-- entry key='database.selectDevicesAll'>
SELECT * FROM devices;
</entry -->
Old:
<entry key='database.selectGroupsAll'>
SELECT * FROM groups;
</entry>
New:
<!-- entry key='database.selectGroupsAll'>
SELECT * FROM groups;
</entry -->
IMPORTANT NOTE : These changes must be done in default configuration file named default.xml
, not in traccar.xml
.
9) Start Traccar service
9a) Only for the first time installation, i.e. not when upgrading from previous versions when the database is already present
Stop Traccar service. Then uncomment queries, which were commented out in step 8a in default configuration file (located in conf\default.xml
of traccar installation folder):
Old:
<!-- entry key='database.selectDevicesAll'>
SELECT * FROM devices;
</entry -->
New:
<entry key='database.selectDevicesAll'>
SELECT * FROM devices;
</entry>
Old:
<!-- entry key='database.selectGroupsAll'>
SELECT * FROM groups;
</entry -->
New:
<entry key='database.selectGroupsAll'>
SELECT * FROM groups;
</entry>
Start Traccar service.
IMPORTANT NOTE : These changes must be done in default configuration file named default.xml
, not in traccar.xml
.
10) If necessary clear web browser cookies related to your traccar web UI. In chrome this can be done like said here