move h2 databases from windows 10 machine to linux 20.04 server

Adsakis3 years ago

So I installed Traccar Linux 64 version 4.13 on a Linux Ubuntu 20.04 server according to the official instructions (https://www.traccar.org/linux/). I decided to move the windows 10 databases of my previous Traccar installation (version 4.12) and move them to the Linux 20.04 installation.

After making sure the devices point to the new sever, everything seems to work well except two devices which do not connect to the new server.
One of this device is a tk103B and the other a G303 device.

I change the communication ports (from 5001 to 5002 to 5013) but no luck. By the way another device works on port 5013.
I reset the devices and went through the configuration again, but no luck.
However when I pointed the two devices to the Traccar demo server, they work just fine.

Is moving the databases not such a good idea or there is something else going on? Again all devices except 2 work on the new server with the copied databases.

Thank you in advance.

Anton Tananaev3 years ago

Title says something about moving database, but the description is about ports. Can you please clarify the question. What exactly do you need help with?

Adsakis3 years ago

Hello Anton,
Thanks for the reply and sorry for not being clear. Let me list the questions:

  1. Is copying the databases from a windows 10 traccar installation (version 4.12) to a Linux Ubuntu server 20.04 traccar x64 (version 4.13) a bad idea?
    If not, question 2:
  2. All of the devices used to work on the windows traccar installation, but when I did the switch couple days ago, two devices (tk103 and to G303) refuse to connect, even though the settings were the same. I tried the two devices on the demo traccar and they work fine, but I still can not make them work on my server.

Thanks in advance.

Anton Tananaev3 years ago
  1. I think it should work just fine.
  2. If I were to guess, you probably have some firewall issue or something along those lines.
Adsakis3 years ago
  1. That is what I thought since the rest of the devices work fine and I can query the database (reports in traccar) just fine.
  2. Another device using port 5013 works fine, but these two devices do not, so I am not sure it is a firewall or port forwarding issue. By the way, these two devices communicated fine with the demo traccar at port 5013.

Another question, can I disable some of the ports that traccar is listening to, but I am not using? If so, how? For example when I use the command in Linux netstat -a I get many ports that traccar listens to (5001 - 5220) , but I do not need traccar to listen to all of them.

Anton Tananaev3 years ago

You can remove unused ports from default.xml.

Adsakis3 years ago

Oh okay, that is pretty easy then to remove unused ports.
Thank you for your help.

Track-trace3 years ago

Meaby you could switch off all other devices that are working. And then only switch on those devices that do not connect. Then check traccar log if those devices actually connect. With working devices switched off it will be easier to check.
I was also thinking, if you have changed server, meaby also server ip changed. Did you check those two devices actually connect to your new server ip and port and have the correct ID set in traccar server.

Adsakis3 years ago

I think the devices do connect, but the HEXs are not being decoded. I may have to disconnect all of the other devices, which is something that I am not looking forwards to, and check the logs again.

The devices are pointing to the correct IP of the new server.

Anton Tananaev3 years ago

I think the devices do connect, but the HEXs are not being decoded

Logs to support this statement?

Adsakis3 years ago

Here is the HEX log line for one of the troubled devices:

...
h02 < 172.58.184.13] HEX: 23232c696d65693a3335393731303034373836333234372c413b
 connected
h02 < 172.58.184.13] HEX: 23232c696d65693a3335393731303034373836333234372c413b
connected
...
Anton Tananaev3 years ago

You are using wrong port for those devices.

Adsakis3 years ago

I have used ports 5001, 5002, and 5013 on the new linux server. None of these ports seem to work.
On the windows server, I used port 5001 and they worked fine.
On the traccar demo I used ports 5001 and 5013 and also worked fine.

Do you know which port I should be using?

Anton Tananaev3 years ago

You should be using the same port - 5001. Why would the port change? Each port is mapped to a single protocol. Changing your OS won't change the protocol that device uses.

Adsakis3 years ago

Originally, I tried port 5001 on the new linux server which did not work. Then I started playing around with other ports based on some forum discussions, but no luck.
I think (not sure) these Chinese clones use the h20 protocol which is mapped to port 5013, but again port 5001 was working fine on the old server.