Schema files are external and it's expected that they are not included in the JAR.
Thank you for the clarification. Reflecting, I can understand why keeping schema files external is intentional, and managing database migrations separately makes sense to avoid accidental changes without backup.
I wonder if it might be beneficial to add a brief note in the Build from source documentation about handling database schema updates. This could help users who might not be aware additional steps may be required when updating from source to ensure the database state matches the server state.
--
For future readers, one solution is to:
/schema
files to a new directory (e.g., /opt/traccar/latest-schema
) to prepare for a manual migration. (Part of CI/CD build steps)/schema
folder with /latest-schema
and notify the user of any differences. If changes are detected, prompt for confirmation that a database backup has been taken; otherwise, exit without action. (shell script)/schema
with /latest-schema
, then start Traccar. (same shell script)It's kind of there:
Make sure you have a compatible version of Traccar installed.
But also you shouldn't use master unless you absolutely know what you're doing. That's because you can get your server into a state where you would have to make database migration manually. It's covered here:
https://www.traccar.org/source-code/
If you decide to use source code, it is recommended to use the latest tag instead of a master branch.
Good afternoon,
Background
I follow the documented server build steps at https://www.traccar.org/build/ within a recently created CICD setup:
Issue / Cause
I encountered a database error due to a missing expected database column. On inspection this was added in the latest changelog
changelog-6.6.xml
.Investigating further, I found that the Gradle-generated
tracker-server.jar
file does not include schema changelogs:This explains why the latest changeset was not implemented.
Question
I would like to confirm whether:
/schema
folder should be relocated to be included in the final .jar by Gradle, or the/schema
folder should be referenced inbuild.gradle
Many thanks