H2 Console

davidball1239 years ago

Is it possible to use H2 Console to view and export the contents of the Traccar H2 database? I want to re-install Traccar server on a dedicated Windows 7 pc and keep the data collected todate.

Anton Tananaev9 years ago

You can just copy the database file.

karthikeyan8 years ago

Hi Anton can you tell me How can i open traccar database in h2 console?

Anton Tananaev8 years ago

Get H2 console and open database files which is located in the "data" folder.

karthikeyan8 years ago

In traccar no folder like that "data" name but in "target" folder i could see "database.trace" and "database.mv"
is this db files?

Anton Tananaev8 years ago

It means that you haven't installed official release.

If you are running from source, you can check config for database file location.

karthikeyan8 years ago

Hi Anton thanks again for your reply , I have an one more doubt i am manually passing the value to saveArea function in geofenceDialogController.js file from userDialogController.js file. saveArea function getting that values but i am getting an error "Cannot read property 'setValue' of null"

this.lookupReference('areaField').setValue(value);

i am passing the value "CIRCLE (11.008503112744123 76.9501574920654, 239.1)"

Anton Tananaev8 years ago

Well, as the error message indicates, your reference lookup failed.

karthikeyan8 years ago

Yes Anton can you tell me how to fix this ?

Anton Tananaev8 years ago

The problem is likely with the code that you added/modified. Debug your code and find the issue.

karthikeyan8 years ago

In usersDialogcontrollers.js file onSaveClick() function i was added the following code.

var destinationLatLong  = "CIRCLE ("+ record.data.latitude+" "+record.data.longitude+","+" 500)";	
var test = new Traccar.view.GeofenceDialogController();
test.saveArea(destinationLatLong);
karthikeyan8 years ago

Hi anton above the code only i do it. Is there any bug?

Anton Tananaev8 years ago

If you need help with customization, please send me an email to discuss it.

To access H2 database, you may deactivate traccar service and then access with following connection sring:

jdbc:h2:~/../../Program Files/Traccar/data/database