pgshiping / jforum2

Automatically exported from code.google.com/p/jforum2
Other
0 stars 0 forks source link

Lost attachments and avatars after re-deploying war. #40

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Deploy jforum war to your server.
2. Add avatar to your profile and add few attachments to post.
3. Re-deploy jforum war again.

What is the expected output? 
Avatars and attachments should be still visible from UI.

What do you see instead?
Avatars and attachments are lost.

What version of the product are you using? On what operating system,
database, and application server/servlet container?
* Product: JForum 2.3.4
* OS: Windows 7
* DB: Postgres
* AP: Tomcat 7

Please provide any additional information below.
Make it possible to store attachments in DB or outside Web Context. It should 
be configurable.

Original issue reported on code.google.com by koziars...@gmail.com on 17 Jul 2012 at 2:10

GoogleCodeExporter commented 8 years ago
How do you do the re-deployment?
There are two configurable keys in SystemGlobals.properties/jforum-custom.conf:
# Directory to store the files
attachments.upload.dir = upload
attachments.store.dir = ${application.path}/${attachments.upload.dir}

# Directory to store the avatar files
avatar.image.dir = images/avatar
avatar.store.dir = ${application.path}/${avatar.image.dir}/

You could unpack the war file, modify it, and then package the war file again.

Original comment by andow...@gmail.com on 18 Jul 2012 at 12:03

GoogleCodeExporter commented 8 years ago
I am using Tomcat and it's web console to manually deploy. Tomcat is basically 
replacing entire war file so everything is lost.
I could create deployment script to copy those folders to temporary directory, 
deploy and then copy back to web folder on Tomcat. But I would prefer not to 
rely on script to do it.
I tried to specify the location of attachments using "../../upload" so it 
stores files outside of web context, but this also seems to be dirty trick. 
Also, it doesn't seem to be working with download of avatars.
How hard would it be to modify code and store it on DB? Is there any reason 
against that approach?

-marcin

Original comment by koziars...@gmail.com on 18 Jul 2012 at 4:39