How to return "database.mv"

VirtualSUN8 years ago

Good time of day.
My server crashed (3.1 version, the PC is not properly shut down). I can not restore it. I have a copy of the file server. Seeing that there is a new version (3.2) has decided to upgrade. But I can not attach a file "database.mv" to save the old route. How can i do this?

VirtualSUN8 years ago

Additional question: When I look in new version (3.2) on old route, how turned off text(date & time) near waypoints?

Anton Tananaev8 years ago

Basically, you need to upgrade your database schema to work with new version. I have a script for MySQL, but not for H2:

https://www.traccar.org/update-from-3-1-to-3-2/

As for date and time on way-points, it's not possible in 3.2, but next version will fix the problem.

markus7 years ago

Hi Anton!

Do you also have a script to update MySQL database from 3.9 to 3.10?

Thanks!
Markus

Anton Tananaev7 years ago

Please read official documentation:

https://www.traccar.org/upgrading-traccar/

markus7 years ago

Thank you Anton!

I could find the problem. After Recovering the MySQL Database my designated Traccar-DB-User on the MySQL had too less permissions. Don't know why.

WARNING|wrapper|Service traccar|17-03-21 21:46:25|YAJSW: yajsw-stable-12.08
WARNING|wrapper|Service traccar|17-03-21 21:46:25|OS   : Linux/4.4.38-v7+/arm
WARNING|wrapper|Service traccar|17-03-21 21:46:25|JVM  : Oracle Corporation/1.8.0_121//usr/lib/jvm/java-8-openjdk-armhf/jre/32
INFO|wrapper|Service traccar|17-03-21 21:46:27|exec:"java" "-classpath" "/opt/traccar/wrapperApp.jar:/opt/traccar/tracker-server.jar:/opt/traccar/lib/log4j-1.2.17.jar:/opt/traccar/lib/joda-time-2.9.7.jar:/opt/traccar/lib/h2-1.4.193.jar:/opt/traccar/lib/mysql-connector-java-5.1.40.jar:/opt/traccar/lib/postgresql-9.4.1212.jre7.jar:/opt/traccar/lib/mssql-jdbc-6.1.0.jre7.jar:/opt/traccar/lib/HikariCP-java7-2.4.11.jar:/opt/traccar/lib/slf4j-api-1.7.21.jar:/opt/traccar/lib/netty-3.10.6.Final.jar:/opt/traccar/lib/async-http-client-1.9.40.jar:/opt/traccar/lib/slf4j-simple-1.7.22.jar:/opt/traccar/lib/javax.json-1.0.4.jar:/opt/traccar/lib/jetty-server-9.2.21.v20170120.jar:/opt/traccar/lib/javax.servlet-api-3.1.0.jar:/opt/traccar/lib/jetty-http-9.2.21.v20170120.jar:/opt/traccar/lib/jetty-io-9.2.21.v20170120.jar:/opt/traccar/lib/jetty-servlet-9.2.21.v20170120.jar:/opt/traccar/lib/jetty-security-9.2.21.v20170120.jar:/opt/traccar/lib/jetty-webapp-9.2.21.v20170120.jar:/opt/traccar/lib/jetty-xml-9.2.21.v20170120.jar:/opt/traccar/lib/jetty-jndi-9.2.21.v20170120.jar:/opt/traccar/lib/jetty-util-9.2.21.v20170120.jar:/opt/traccar/lib/websocket-server-9.2.21.v20170120.jar:/opt/traccar/lib/websocket-common-9.2.21.v20170120.jar:/opt/traccar/lib/websocket-api-9.2.21.v20170120.jar:/opt/traccar/lib/websocket-client-9.2.21.v20170120.jar:/opt/traccar/lib/websocket-servlet-9.2.21.v20170120.jar:/opt/traccar/lib/jersey-container-servlet-2.25.1.jar:/opt/traccar/lib/jersey-container-servlet-core-2.25.1.jar:/opt/traccar/lib/javax.inject-2.5.0-b32.jar:/opt/traccar/lib/jersey-common-2.25.1.jar:/opt/traccar/lib/javax.annotation-api-1.2.jar:/opt/traccar/lib/jersey-guava-2.25.1.jar:/opt/traccar/lib/hk2-api-2.5.0-b32.jar:/opt/traccar/lib/hk2-utils-2.5.0-b32.jar:/opt/traccar/lib/aopalliance-repackaged-2.5.0-b32.jar:/opt/traccar/lib/hk2-locator-2.5.0-b32.jar:/opt/traccar/lib/javassist-3.20.0-GA.jar:/opt/traccar/lib/osgi-resource-locator-1.0.1.jar:/opt/traccar/lib/jersey-server-2.25.1.jar:/opt/traccar/lib/jersey-client-2.25.1.jar:/opt/traccar/lib/jersey-media-jaxb-2.25.1.jar:/opt/traccar/lib/validation-api-1.1.0.Final.jar:/opt/traccar/lib/javax.ws.rs-api-2.0.1.jar:/opt/traccar/lib/jersey-media-json-jackson-2.25.1.jar:/opt/traccar/lib/jersey-entity-filtering-2.25.1.jar:/opt/traccar/lib/jackson-jaxrs-base-2.8.4.jar:/opt/traccar/lib/jackson-core-2.8.4.jar:/opt/traccar/lib/jackson-databind-2.8.4.jar:/opt/traccar/lib/jackson-jaxrs-json-provider-2.8.4.jar:/opt/traccar/lib/jackson-module-jaxb-annotations-2.8.4.jar:/opt/traccar/lib/jackson-annotations-2.8.4.jar:/opt/traccar/lib/liquibase-core-3.5.3.jar:/opt/traccar/lib/snakeyaml-1.17.jar:/opt/traccar/lib/mail-1.4.7.jar:/opt/traccar/lib/activation-1.1.jar:/opt/traccar/lib/jxls-2.3.0.jar:/opt/traccar/lib/commons-jexl-2.1.1.jar:/opt/traccar/lib/commons-logging-1.1.1.jar:/opt/traccar/lib/commons-beanutils-1.9.2.jar:/opt/traccar/lib/jcl-over-slf4j-1.7.12.jar:/opt/traccar/lib/logback-core-1.1.3.jar:/opt/traccar/lib/jxls-poi-1.0.11.jar:/opt/traccar/lib/poi-3.14.jar:/opt/traccar/lib/poi-ooxml-3.14.jar:/opt/traccar/lib/poi-ooxml-schemas-3.14.jar:/opt/traccar/lib/xmlbeans-2.6.0.jar:/opt/traccar/lib/stax-api-1.0.1.jar:/opt/traccar/lib/curvesapi-1.03.jar:/opt/traccar/lib/velocity-1.7.jar:/opt/traccar/lib/commons-collections-3.2.1.jar:/opt/traccar/lib/commons-lang-2.4.jar:/opt/traccar/lib/ical4j-2.0.0.jar:/opt/traccar/lib/commons-collections4-4.0.jar:/opt/traccar/lib/groovy-all-2.3.2.jar:/opt/traccar/lib/bndlib-2.3.0.jar:/opt/traccar/lib/org.osgi.core-4.3.1.jar:/opt/traccar/lib/commons-lang3-3.3.2.jar:/opt/traccar/lib/commons-codec-1.9.jar" "-Dfile.encoding=UTF-8" "-Xrs" "-Dwrapper.service=true" "-Dwrapper.console.visible=false" "-Dwrapper.port=15003" "-Dwrapper.key=1568669152032573390" "-Dwrapper.teeName=1568669152032573390$1490129184766" "-Dwrapper.tmp.path=/opt/traccar/tmp" "-Djna_tmpdir=/opt/traccar/tmp" "-Dwrapper.config=/opt/traccar/conf/wrapper.conf" "-Dwrapper.visible=false" "-Dwrapper.pidfile=/run/wrapper.traccar.pid" "org.rzo.yajsw.app.WrapperJVMMain"
INFO|wrapper|Service traccar|17-03-21 21:46:27|posix_spawn pid 10726
INFO|wrapper|Service traccar|17-03-21 21:46:27|started process 10726
INFO|wrapper|Service traccar|17-03-21 21:46:27|started process with pid 10726
INFO|10726/0|Service traccar|17-03-21 21:46:40|[INFO] StandardFileSystemManager - Using "/tmp/vfs_cache" as temporary files store.
INFO|10726/0|Service traccar|17-03-21 21:46:49|[main] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Starting...
INFO|10726/0|Service traccar|17-03-21 21:46:53|[main] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Start completed.
INFO|10726/0|Service traccar|17-03-21 21:47:11|INFO 3/21/17 9:47 PM: liquibase: Clearing database change log checksums
INFO|10726/0|Service traccar|17-03-21 21:47:14|INFO 3/21/17 9:47 PM: liquibase: Successfully acquired change log lock
INFO|10726/0|Service traccar|17-03-21 21:47:14|INFO 3/21/17 9:47 PM: liquibase: Successfully released change log lock
INFO|10726/0|Service traccar|17-03-21 21:47:15|INFO 3/21/17 9:47 PM: liquibase: Successfully acquired change log lock
INFO|10726/0|Service traccar|17-03-21 21:48:59|INFO 3/21/17 9:48 PM: liquibase: Reading from traccar_tmp.DATABASECHANGELOG
INFO|10726/0|Service traccar|17-03-21 21:49:07|INFO 3/21/17 9:49 PM: liquibase: Reading from traccar_tmp.DATABASECHANGELOG
INFO|10726/0|Service traccar|17-03-21 21:49:10|INFO 3/21/17 9:49 PM: liquibase: /opt/traccar/schema/changelog-master.xml: changelog-3.8::changelog-3.8-dropuniquetoken::author: Change set changelog-3.8::changelog-3.8-dropuniquetoken::author failed, but failOnError was false.  Error: ALTER command denied to user 'WelAPitraccar'@'localhost' for table 'users' [Failed SQL: ALTER TABLE traccar_tmp.users DROP KEY uk_user_token]
INFO|10726/0|Service traccar|17-03-21 21:49:10|SEVERE 3/21/17 9:49 PM: liquibase: /opt/traccar/schema/changelog-master.xml: changelog-3.10::changelog-3.10::author: Change Set changelog-3.10::changelog-3.10::author failed.  Error: CREATE command denied to user 'WelAPitraccar'@'localhost' for table 'calendars' [Failed SQL: CREATE TABLE traccar_tmp.calendars (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(128) NOT NULL, data BLOB NOT NULL, attributes VARCHAR(4000) NOT NULL, CONSTRAINT PK_CALENDARS PRIMARY KEY (id))]
INFO|10726/0|Service traccar|17-03-21 21:49:10|INFO 3/21/17 9:49 PM: liquibase: changelog-3.10::changelog-3.10::author: Successfully released change log lock
INFO|10726/0|Service traccar|17-03-21 21:49:10|java.lang.reflect.InvocationTargetException
INFO|10726/0|Service traccar|17-03-21 21:49:10| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
INFO|10726/0|Service traccar|17-03-21 21:49:10| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
INFO|10726/0|Service traccar|17-03-21 21:49:10| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
INFO|10726/0|Service traccar|17-03-21 21:49:10| at java.lang.reflect.Method.invoke(Method.java:498)
INFO|10726/0|Service traccar|17-03-21 21:49:10| at org.rzo.yajsw.app.WrapperJVMMain.executeMain(WrapperJVMMain.java:60)
INFO|10726/0|Service traccar|17-03-21 21:49:10| at org.rzo.yajsw.app.WrapperJVMMain.main(WrapperJVMMain.java:43)
INFO|10726/0|Service traccar|17-03-21 21:49:10|Caused by: liquibase.exception.MigrationFailedException: Migration failed for change set changelog-3.10::changelog-3.10::author:
INFO|10726/0|Service traccar|17-03-21 21:49:10|     Reason: liquibase.exception.DatabaseException: CREATE command denied to user 'WelAPitraccar'@'localhost' for table 'calendars' [Failed SQL: CREATE TABLE traccar_tmp.calendars (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(128) NOT NULL, data BLOB NOT NULL, attributes VARCHAR(4000) NOT NULL, CONSTRAINT PK_CALENDARS PRIMARY KEY (id))]
INFO|10726/0|Service traccar|17-03-21 21:49:10| at liquibase.changelog.ChangeSet.execute(ChangeSet.java:619)
INFO|10726/0|Service traccar|17-03-21 21:49:10| at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:51)
INFO|10726/0|Service traccar|17-03-21 21:49:10| at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:79)
INFO|10726/0|Service traccar|17-03-21 21:49:10| at liquibase.Liquibase.update(Liquibase.java:214)
INFO|10726/0|Service traccar|17-03-21 21:49:10| at liquibase.Liquibase.update(Liquibase.java:192)
INFO|10726/0|Service traccar|17-03-21 21:49:10| at liquibase.Liquibase.update(Liquibase.java:188)
INFO|10726/0|Service traccar|17-03-21 21:49:10| at org.traccar.database.DataManager.initDatabaseSchema(DataManager.java:145)
INFO|10726/0|Service traccar|17-03-21 21:49:10| at org.traccar.database.DataManager.<init>(DataManager.java:71)
INFO|10726/0|Service traccar|17-03-21 21:49:10| at org.traccar.Context.init(Context.java:198)
INFO|10726/0|Service traccar|17-03-21 21:49:10| at org.traccar.Main.main(Main.java:35)
INFO|10726/0|Service traccar|17-03-21 21:49:10| ... 6 more
INFO|10726/0|Service traccar|17-03-21 21:49:10|Caused by: liquibase.exception.DatabaseException: CREATE command denied to user 'WelAPitraccar'@'localhost' for table 'calendars' [Failed SQL: CREATE TABLE traccar_tmp.calendars (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(128) NOT NULL, data BLOB NOT NULL, attributes VARCHAR(4000) NOT NULL, CONSTRAINT PK_CALENDARS PRIMARY KEY (id))]
INFO|10726/0|Service traccar|17-03-21 21:49:10| at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:309)
INFO|10726/0|Service traccar|17-03-21 21:49:10| at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:55)
INFO|10726/0|Service traccar|17-03-21 21:49:10| at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:113)
INFO|10726/0|Service traccar|17-03-21 21:49:10| at liquibase.database.AbstractJdbcDatabase.execute(AbstractJdbcDatabase.java:1277)
INFO|10726/0|Service traccar|17-03-21 21:49:10| at liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1259)
INFO|10726/0|Service traccar|17-03-21 21:49:10| at liquibase.changelog.ChangeSet.execute(ChangeSet.java:582)
INFO|10726/0|Service traccar|17-03-21 21:49:10| ... 15 more
INFO|10726/0|Service traccar|17-03-21 21:49:11|Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: CREATE command denied to user 'WelAPitraccar'@'localhost' for table 'calendars'
INFO|10726/0|Service traccar|17-03-21 21:49:11| at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
INFO|10726/0|Service traccar|17-03-21 21:49:11| at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
INFO|10726/0|Service traccar|17-03-21 21:49:11| at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
INFO|10726/0|Service traccar|17-03-21 21:49:11| at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
INFO|10726/0|Service traccar|17-03-21 21:49:11| at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
INFO|10726/0|Service traccar|17-03-21 21:49:11| at com.mysql.jdbc.Util.getInstance(Util.java:408)
INFO|10726/0|Service traccar|17-03-21 21:49:11| at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:943)
INFO|10726/0|Service traccar|17-03-21 21:49:11| at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3970)
INFO|10726/0|Service traccar|17-03-21 21:49:11| at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3906)
INFO|10726/0|Service traccar|17-03-21 21:49:11| at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2524)
INFO|10726/0|Service traccar|17-03-21 21:49:11| at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2677)
INFO|10726/0|Service traccar|17-03-21 21:49:11| at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2545)
INFO|10726/0|Service traccar|17-03-21 21:49:11| at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2503)
INFO|10726/0|Service traccar|17-03-21 21:49:11| at com.mysql.jdbc.StatementImpl.executeInternal(StatementImpl.java:839)
INFO|10726/0|Service traccar|17-03-21 21:49:11| at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:739)
INFO|10726/0|Service traccar|17-03-21 21:49:11| at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:307)
INFO|10726/0|Service traccar|17-03-21 21:49:11| ... 20 more
INFO|wrapper|Service traccar|17-03-21 21:49:11|waitpid 10726 59136
INFO|wrapper|Service traccar|17-03-21 21:49:11|exit code posix process: 59136 application: 0

Tried the update with an Admin-MySQL-User and it worked.

Once more a learning for me: 'The one who reads log files is the one who solves the problems !'.

Sorry for the inconvenience!

Yours
Markus