*********************************************
*********************************************
*	Upgrade the OpenBD 2.0.2 Viviotech 		*
*	instaled "single install" server		*
*											*
*	Author: Alan Cole						*
*											*
*	Permisison to replicate, distribute, 	*
*	modify, extend. If you find an issue	*
*	and resolve it, please give back to		*
*	the community. Thank you.				*
*********************************************
*********************************************

This zip file is the result of my needing to upgrade our
development and production environments from the openBD
2.0.2 version which comes in the VivioTech installer. You
can find the installer here:

http://openbd.viviotech.net

The installer was a great help with our shop in moving
from ACF to OpenBD. Our development and deployment environments
were all set up with the ACF model of a single server install
that servered multiple sites/applications through virtual
hosts.

The VivioTech installer did that wonderfully. After the
installer was run and we configured Apache as our httpd server
we were able to use the Apache virtual host in conjuction
with the Tomcat context hosts directives to server multiple
sites/application on the same system with the same OpenBD
server.

The issue arose when we needed to upgrade. We have hundreds of
sites running, over multiple physical servers and there isn't
a new installer for the newer versions of OpenBD.

Thus everything I did comes from the standpoint or starting
point of having a valid, running system that is setup (from
the standpoint of OpenBD) through the VivioTech install.
That said, this is what our "stack" looks like.

Apache, Tomcat 7.0.23, OpenBD 2.0.2 (JDK 1.6.0_30) on *Nix system host.

If you have a running system similar, then you should be able
to use this zip file to upgrade your system to the newer versions.

If you found this thread, and have been looking to upgrade your
OpenBD there is a good chance that you've read other threads
that indicate that you should be able to just download the
OpenBD Jars and replace them and be good to go. This was my
first stop on this upgrade journey. It was not a pretty stop,
and there was no ice cream.

The issue that I ran into was a mis-match of versions. So the 3.2
OpenBD wants to have Java 7 at least to be happy. But if you
mess with the JDK within the install, then Tomcat is upset because
it specifically wants Java 6. So I had to upgrade the entire
stack.

I attempted to upgrade sub components individually, in-place on
one of our development systems and ran into some major issues. One
of my top priorities with this was to find and be able to implement
an upgrade process that honored the live / production environment
such that there was minimal to no 'down time' durning the upgrade.
This was the major priority and you will see where it influenced
the process.

So here is the install/upgrade process.

1. Start with a valid, running stack build (from the OpenBD part) with
the VivioTech Installer. This should mean that you will have a running
server with a single OpenBD instal that is running version 2.0.2, JDK
1.6 and Tomcat 7.0

The installer recommends the installation directory of
/opt/openbd

This is what I did years ago and so this is what we work with during
this process.

2. Needed to ensure that I could "roll back" the changes should there
be any issues during the upgrade. So I stopped the openBD server and
then moved the /opt/openbd folder:

	[opt]# mv openbd openbd_2.0.2

Then created a symbolic link to the new folder:

	[opt]# ln -s openbd_2.0.2 openbd

So I now have two entries in the /opt directory. 'ls -l' shows the
following:

	lrwxrwxrwx  1 root root      12 Sep 17 11:21 openbd -> openbd_2.0.2
	drwxr-xr-x 14 root root    4096 Sep 16 13:53 openbd_2.0.2

Restart the OpenBD server. Everything should still be running on the
original install. You may need to ensure that your Apache has followSym
links on. For me, everything worked properly and tested correctly.

3. Create a new directory in /opt called openbd_3.2.0

	[opt]# mdkir openbd_3.2.0

Now 'ls -l' shows the following:

	lrwxrwxrwx  1 root root      12 Sep 17 11:21 openbd -> openbd_2.0.2
	drwxr-xr-x 14 root root    4096 Sep 16 13:53 openbd_2.0.2
	drwxr-xr-x 13 root root    	  0 Sep 17 09:41 openbd_3.2.0

4. Take the 'openbd_3.2.0_clean.tar' from within this zip and move it
to the new directory (/opt/openbd_3.2.0/) and then untar it.

	[opt/openbd_3.2.0]# tar -xvf openbd_3.2.0_clean.tar

Check ownership of the files. I believe that all the files within my
install are owned by root. This should carry over from the tar file.

At this point you should have a workable OpenBD stack - but it won't
be configured. Again, remember that my point is to upgrade an existing
installation. If you only want a clean install then you can skip the
next step and go on to step 6.

5. Copy over the configuration files from your previous install.
There are two files that you *MUST* migrate over, a third if you have
tweaked your java environment variables.

First is your OpenBD conf file. This contains the settings that you
have changed and implemented in the control panel, including datasources,
admin password, mappings, etc.

	[opt]# cp openbd_2.0.2/conf/bluedragon.xml openbd_3.2.0/conf/bluedragon.xml

Second is the Tomcat conf file that contains the context host configurations
so that your virtual hosts match up properly.

	[opt]# cp openbd_2.0.2/tomcat/conf/server.xml openbd_3.2.0/tomcat/conf/server.xml

The third file is important if you have modified it in your previous
installation, but if you have not modified it then skip this one. It is the
Java conf file that controlls how you tweak the java server.

	[opt]# cp openbd_2.0.2/tomcat/bin/setenv.sh openbd_3.2.0/tomcat/bin/setenv.sh

Last thing to consider is if you have installed custom classes or customtags.
If you have then copy those over from the openbd_2.0.2/classes & 
openbd_2.0.2/customtags directories respectively. You may also do this later
if you want. I did not have any, so I didn't concern myself with this part.

6. Change over the 'running' server from the 2.0.2 to the 3.2.0. To do this
all you have to do is stop the OpenBD server. Then delete the opt/openbd symlink
and recreate it pointed to the openbd_3.2.0, and then restart the OpenBD.

	[opt]# /etc/init.d/openbd_ctl stop

	[opt]# rm openbd

	[opt]# ln -s openbd_3.2.0 openbd

Your 'ls -l' should now show the following:

	lrwxrwxrwx  1 root root      12 Sep 17 11:21 openbd -> openbd_3.2.0
	drwxr-xr-x 14 root root    4096 Sep 16 13:53 openbd_2.0.2
	drwxr-xr-x 13 root root    4096 Sep 17 09:41 openbd_3.2.0

Now restart the OpenBD server:

	[opt]# /etc/init.d/openbd_ctl start

You should now be able to connect to the OpenBD control panel / admin
site and login. The "Server" > "System Info" page should now show
similar to the "openbd-server-info.png" screen shot that I included
with the zip:

	OpenBD Product Version: 3.2 (written 3,2)
	Application Server: Apache Tomcat/8.0.26
	Java Virtual Machine: 1.7.0_79

If you need to roll back to the previous install, if one of your sites
doesn't come back up or you find any other issues - simply shut down the
OpenBD server and then reverse the process in step 6 (delete the 'openbd'
symlink and recreate it pointed to the 2.0.2 install) and restart the
OpenBD server.












