Images are lost when restarting tomcat

It happens that when you have to restart tomcat because the server was updated or some internal change was made, and it is necessary to restart the service, all images of “Apps management” are lost. Also the company logo having to upload it again. I tried to change the option: “db.default in the” application.propierties "file.
ddl = update “a” db.default.ddl = none “but when restarting tomcat (with the hope that I would not recreate the DB scheme and lose the images), it didn’t even show me” login.jps "but instead There was a publishing error. Then I left the value in update again and raised the system.
How can I do it so that every time I have to restart tomcat I don’t lose the indexing of the images and stop showing them?

Check the property “file.upload.dir” of application.properties file. It is the path to store all attachments including images.

Hi, thanks for the answer @sos-axelor it happens that I saw the file on the line that you indicate and I get: « file.upload.dir = {java.io.tmpdir}/axelor » So what I don’t know is if I should replace from « /axelor » for my path where is axelor’s war decompressed on my computer? for example: it would be: « file.upload.dir={java.io.tmpdir}/var/lib/tomcat8/webapps/axelor » ??? I already appreciate your help and prompt disposition to respond. I enclose image with what happens to me every time I restart tomcat

You can replace it with any static path. But as it was temp directory you may lost previous attachments, you have to test with new war, but before deployment change this property to some static path.

1 « J'aime »

Ok what I did then was the following:

I made all the changes:

  1. I modified the application.properties file in the direct paths to save the images in a folder that after decompressing the .war create called « images »
  2. create a new DB that I also modified in the file
  3. I restarted Tomcat and when he finished he did not show me the images, he left me the squares blank, as if they were but cannot be seen.

I am very grateful for your help in this regard

Hi,
Looks like you still use the old database. Check that files are present in /home/admin/axelor/images.
Easier than extracting war, you can pass -Daxelor.config=/path/to/external/axelor.properties on tomcat comand line to have an upgrade-proof configuration.

Hi, @beuss he didn’t load anything in the created folder “images” and I would like to know if you can guide me a little more in relation to these modifications: Daxelor.config=/path/to/external/axelor.properties on tomcat comand line to have an upgrade-proof configuration.??? My environment is Debian 9 Tomcat 8.5 and postgres 9.6.15.

I thank you very much for running away from how to do it and support.

Hi,

edit /etc/default/tomcat8 to add JAVA_OPTS="${JAVA_OPTS} -Daxelor.config=/etc/axelor.properties" on the last line, this will tell axelor to use the specified file as config file, this will avoid the need of editing war content. Init the file with the one in the war and modify db & storage dir options. Be sure that tomcat user (tomcat8) can access all storage paths in write mode (if you’re a sudoer a simple sudo -u tomcat8 touch /path/to/upload/dir/test && sudo -u tomcat8 rm /path/to/upload/dir/test should be sucessful).

1 « J'aime »

Hello @beuss me worked perfectly and everything looks again without further problems restarting Tomcat have not lost images and maintains integrity. I did everything you told me. Thank you very much large teams of support and help this great and free platform.:smiley::smiley::smiley::smiley::smiley::dizzy::v::muscle::muscle::muscle:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.