PWM upgrade

1,069 views
Skip to first unread message

thecha...@gmail.com

unread,
Nov 9, 2016, 3:08:30 AM11/9/16
to pwm-general
Hi all,
I'm going to place in production the system after a bit of tests.
The system works fine BTW but i'm searching a way to proceed for regular update of the procedure.
I do have the PWM folder that on WEB-INF contains the settings and the localdb but i do also uploaded the driver to connect to my sql server and i do not think that the standard war contains it.
Is there any way to upgrade it?
Any help would be appreciated.
Regards
Giorgio

thecha...@gmail.com

unread,
Nov 18, 2016, 8:59:46 AM11/18/16
to pwm-general, thecha...@gmail.com
Up, anyone using this product and is going to think to perform updates on a regular basis?

Regards

jason.e...@gmail.com

unread,
Nov 21, 2016, 8:07:08 PM11/21/16
to pwm-general, thecha...@gmail.com
You can set a separate path outside of the web container for the settings and localdb, like /opt/pwm

https://github.com/pwm-project/pwm/blob/master/src/main/webapp/WEB-INF/web.xml#L35-L36

How are you building the WAR? Or are you downloading the snapshots? If you start to build the WAR yourself you can setup an overlay so that your changes such as the mysql jar are automatically injected.

JASON

thecha...@gmail.com

unread,
Nov 22, 2016, 12:48:55 AM11/22/16
to pwm-general, thecha...@gmail.com, jason.e...@gmail.com
Thanks a lot for the answer.
I'm deploying by war file using the snapshots, i do not build it manually, this is why i'm having problems.
THanks again for the help.
Regards

jason.e...@gmail.com

unread,
Nov 22, 2016, 11:07:28 AM11/22/16
to pwm-general, thecha...@gmail.com, jason.e...@gmail.com
Ok, so to upgrade,

1. STOP Tomcat and Apache

2. Backup the entire pwm folder and pwm.war in Tomcats webapps directory. 3 & 4 is redundant but better to be safe.

3. Copy the /WEB-INF/LocalDB folder to another location outside of Tomcat

4. Copy the /WEB-INF/PwmConfiguration.xml to another location outside of Tomcat

5. Copy any other modifications/additions you made, for MySQL Driver, you could just put that into Tomcats global directory, for Ubuntu, it is /usr/share/tomcat(6/7)/lib this way any web application can make use of it.

6. Delete the pwm.war and pwm folder from the webapps directory.
7. Deploy new pwm.war and start tomcat. After it starts up just STOP tomcat. Copy back your LocalDB and PwmConfiguration.xml back to the applications directory.

I dont think I missed anything,

JASON

jason.e...@gmail.com

unread,
Nov 22, 2016, 11:26:51 AM11/22/16
to pwm-general, thecha...@gmail.com, jason.e...@gmail.com
I posted to the wiki, if anyone has a Windows install feel free to add to it!

https://github.com/pwm-project/pwm/wiki/Upgrading

thecha...@gmail.com

unread,
Nov 22, 2016, 11:30:18 AM11/22/16
to pwm-general, thecha...@gmail.com, jason.e...@gmail.com
Thanks for the detailed answer, do you know where the drivers are placed once they are put by the installer? I cannot find them....

jason.e...@gmail.com

unread,
Nov 22, 2016, 11:43:05 AM11/22/16
to pwm-general, thecha...@gmail.com, jason.e...@gmail.com
I am not sure on that one! We have been using PWM before that feature was added so ours has always been in tomcats global /lib directory, we also have other tomcat applications that use the driver so it was always easier to put there instead of every applications classpath.

I would assume it would be in the /work directory but I am not sure. What OS are you using? If you still cannot find it, just drop into tomcats lib directory. Nothing needs to be changed in pwm, it all stays the same and pwm would not know the difference in any case.

jason.e...@gmail.com

unread,
Nov 22, 2016, 11:44:41 AM11/22/16
to pwm-general, thecha...@gmail.com, jason.e...@gmail.com
Also, if you dont have it downloaded, you can just download the zip and pull out the .jar file,

https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.40.zip

thecha...@gmail.com

unread,
Nov 23, 2016, 5:19:43 AM11/23/16
to pwm-general, thecha...@gmail.com, jason.e...@gmail.com
Il giorno martedì 22 novembre 2016 17:44:41 UTC+1, jason.e...@gmail.com ha scritto:
> Also, if you dont have it downloaded, you can just download the zip and pull out the .jar file,
>
> https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.40.zip

Well that's what i was thinking, i'm under sql server so i'll do it with that libs.

Jason Rivard

unread,
Nov 28, 2016, 1:21:42 AM11/28/16
to pwm-general, thecha...@gmail.com, jason.e...@gmail.com
Some suggestions:

- Do not put the data path inside the WEB-INF directory.  For quite some time, it's best to follow the instructions at /pwm/public/reference -> Environment and use a system environment variable to set a directory for the pwm working files - aka Application Path.
- JDBC driver can be uploaded to the configuration, it won't exist on the filesystem, it becomes part of the PwmConfiguration.xml.

If you use this approach you need only swap the war file to change versions.

thecha...@gmail.com

unread,
Nov 28, 2016, 2:52:44 AM11/28/16
to pwm-general, thecha...@gmail.com, jason.e...@gmail.com
Hi Jason,
thanks for the suggestion but unfortunately, even doing what you wrote (set up a system variable for the path), the update made by placing simply the war does not work, the webinf folder, containing the data is overwritten.
Do you mean that it should be better to place the apppath outside the application directory?

Regards

jason.e...@gmail.com

unread,
Nov 28, 2016, 10:46:42 AM11/28/16
to pwm-general, thecha...@gmail.com, jason.e...@gmail.com
In any case, yes, it should be outside of the application directory, and more or less outside of tomcat completely. Example /opt/pwmdata or windows c:\pwmdata

jason.e...@gmail.com

unread,
Nov 28, 2016, 10:53:28 AM11/28/16
to pwm-general, thecha...@gmail.com, jason.e...@gmail.com
Within setenv.sh it would be

export PWM_APPLICATIONPATH=/opt/pwmdata

Jason can correct me if I am wrong, if you rename the war/application to something else like 'mypwm' , it should be

export MYPWM_APPLICATIONPATH=/opt/pwmdata

Jason Rivard

unread,
Nov 29, 2016, 3:26:15 AM11/29/16
to pwm-general, thecha...@gmail.com, jason.e...@gmail.com
Agreed.  Somewhere outside the tomcat/sspr folder structure is ideal.  Setting it inside WEB-INF is not recommended and is the reason this setting was added in the first place.

rjrb...@digitalsilk.net

unread,
Aug 2, 2017, 5:06:10 PM8/2/17
to pwm-general, thecha...@gmail.com, jason.e...@gmail.com
On Tuesday, November 22, 2016 at 10:26:51 AM UTC-6, jason.e...@gmail.com wrote:
> I posted to the wiki, if anyone has a Windows install feel free to add to it!
>
> https://github.com/pwm-project/pwm/wiki/Upgrading

Jason,

I used your Linux instructions as a basis for attempting Windows and there are a couple of items that may need noting that likely apply to both platforms depending on what the situation is:
1) I had to update my JDK
2) The application path needs to be set
3) Additional DB access rights may be needed (e.g. create table) if it was locked down tightly as it is in my case

I need to revisit this at a later date since this exercise determined that fitting the upgrade in before Fall classes start (I work at a university) is unlikely. Thanks for the wiki doc though!

-Robert

jason.e...@gmail.com

unread,
Sep 6, 2017, 10:56:10 AM9/6/17
to pwm-general, thecha...@gmail.com, jason.e...@gmail.com, rjrb...@digitalsilk.net
Ok awesome, I updated it, if it doesn't make sense let me know. I didn't add the external db info since it is only written when using the LocalDB. We have been using PWM for many years now so when I update it is quick and I might have left something out in the wiki that needs notating, like those little things you mentioned.

There really should be a new section written up for configuring PWM with a 3rd party db such as sql server, mysql, or postgresql.

JASON

Reply all
Reply to author
Forward
0 new messages