Просмотр исходного кода

Merge pull request #673 from Bonitasoft-Community/master

Add explanation to migrate Bonita BPM in 7.3.x
Tianon Gravi 9 лет назад
Родитель
Сommit
3d16b2afaa
1 измененных файлов с 93 добавлено и 39 удалено
  1. 93 39
      bonita/content.md

+ 93 - 39
bonita/content.md

@@ -101,47 +101,49 @@ $ chcon -Rt svirt_sandbox_file_t /my/own/datadir
 
 ## Migrate from an earlier version of Bonita BPM
 
-1.	Stop the container to perform a backup
+-	Stop the container to perform a backup
 
 	```console
-	$ docker stop bonita_7.0.0_postgres
+	$ docker stop bonita_7.2.3_postgres
 	```
 
-2.	Check where your data are stored
+-	For containers < 7.3.0 :
 
-	```console
-	$ docker inspect bonita_7.0.0_postgres
-	[...]
-	    "Mounts": [
-	        {
-	            "Source": "/home/user/Documents/Docker/Volumes/bonita_7.0.0_postgres",
-	            "Destination": "/opt/bonita",
-	            "Mode": "",
-	            "RW": true
-	        }
-	    ],
-	[...]
-	```
+	-	Check where your data are stored
+
+		```console
+		$ docker inspect bonita_7.2.3_postgres
+		[...]
+		    "Mounts": [
+		        {
+		            "Source": "/home/user/Documents/Docker/Volumes/bonita_7.2.3_postgres",
+		            "Destination": "/opt/bonita",
+		            "Mode": "",
+		            "RW": true
+		        }
+		    ],
+		[...]
+		```
 
-3.	Copy data from the filesystem
+	-	Copy data from the filesystem
 
-		cp -r bonita_7.0.0_postgres bonita_7.0.3_postgres
+			cp -r bonita_7.2.3_postgres bonita_migration
 
-4.	Retrieve the DB container IP
+-	Retrieve the DB container IP
 
 	```console
 	$ docker inspect --format '{{ .NetworkSettings.IPAddress }}' mydbpostgres
 	172.17.0.26
 	```
 
-5.	Dump the database
+-	Dump the database
 
 		export PGPASSWORD=mysecretpassword
 		pg_dump -O -x -h 172.17.0.26 -U postgres bonitadb > /tmp/bonitadb.sql
 
 	Note that businessdb won't be updated with the migration tool but you may want to also backup/move it.
 
-6.	Load the dump
+-	Load the dump
 
 		export PGPASSWORD=mysecretpassword
 		psql -U postgres -h 172.17.0.26 -d postgres -c "CREATE USER newbonitauser WITH PASSWORD 'newbonitapass';"
@@ -149,26 +151,38 @@ $ chcon -Rt svirt_sandbox_file_t /my/own/datadir
 		export PGPASSWORD=newbonitapass
 		cat /tmp/bonitadb.sql | psql -U newbonitauser -h 172.17.0.26 newbonitadb
 
-7.	Retrieve the last migration tool and the target version of the Bonita bundle
+-	Retrieve the last migration tool
+
+	-	If you migrate to a version < 7.3.0
+
+		-	get also the target version of the Bonita bundle
 
-		cd bonita_7.0.3_postgres
-		wget http://download.forge.ow2.org/bonita/bonita-migration-distrib-2.2.0.zip
-		wget http://download.forge.ow2.org/bonita/BonitaBPMCommunity-7.0.3-Tomcat-7.0.55.zip
-		unzip bonita-migration-distrib-2.2.0.zip -d bonita-migration-distrib-2.2.0
-		unzip BonitaBPMCommunity-7.0.3-Tomcat-7.0.55.zip
+		```console
+		cd bonita_migration
+		wget http://download.forge.ow2.org/bonita/bonita-migration-distrib-2.15.0.zip
+		wget http://download.forge.ow2.org/bonita/BonitaBPMCommunity-7.2.4-Tomcat-7.0.67.zip
+		unzip bonita-migration-distrib-2.15.0.zip
+		unzip BonitaBPMCommunity-7.2.4-Tomcat-7.0.67.zip
+		```
 
-8.	Move the previous Home into the new bundle
+		-	Move the previous Home into the new bundle
 
-		mv BonitaBPMCommunity-7.0.3-Tomcat-7.0.55/bonita/ BonitaBPMCommunity-7.0.3-Tomcat-7.0.55/bonita.orig
-		cp -r BonitaBPMCommunity-7.0.0-Tomcat-7.0.55/bonita/ BonitaBPMCommunity-7.0.3-Tomcat-7.0.55/bonita/
+		```console
+		mv BonitaBPMCommunity-7.2.4-Tomcat-7.0.67/bonita/ BonitaBPMCommunity-7.2.4-Tomcat-7.0.67/bonita.orig
+		cp -r BonitaBPMCommunity-7.2.3-Tomcat-7.0.67/bonita/ BonitaBPMCommunity-7.2.4-Tomcat-7.0.67/bonita/
+		```
 
-9.	Configure the migration tool
+	-	If you migrate to a version >= 7.3.0
 
-		cd bonita-migration-distrib-2.2.0/
+		```console
+		cd bonita_migration
+		wget http://download.forge.ow2.org/bonita/bonita-migration-distrib-2.15.0.zip
+		unzip bonita-migration-distrib-2.15.0.zip
+		```
 
-	add the jdbc driver
+-	Configure the migration tool
 
-		cp ../BonitaBPMCommunity-7.0.0-Tomcat-7.0.55/lib/bonita/postgresql-9.3-1102.jdbc41.jar lib/
+		cd bonita-migration-distrib-2.15.0
 
 	edit the migration tool config to point towards the copy of bonita home and db
 
@@ -176,21 +190,61 @@ $ chcon -Rt svirt_sandbox_file_t /my/own/datadir
 
 	For example :
 
-		bonita.home=/home/user/Documents/Docker/Volumes/bonita_7.0.3_postgres/BonitaBPMCommunity-7.0.3-Tomcat-7.0.55/bonita
 		db.vendor=postgres
 		db.url=jdbc:postgresql://172.17.0.26:5432/newbonitadb
 		db.driverClass=org.postgresql.Driver
 		db.user=newbonitauser
 		db.password=newbonitapass
+		# location of the bonita home (only useful when migration from version before 7.3.0)
+		bonita.home=/home/user/Documents/Docker/Volumes/bonita_migration/BonitaBPMCommunity-7.2.3-Tomcat-7.0.67/bonita
+
+-	Launch the migration
+
+		cd bin
+		./bonita-migration-distrib
+
+-	Launch the new container pointing towards the copy of DB and filesystem
+
+	-	If < 7.3.0
+
+	```console
+	$ docker run --name=bonita_7.2.4_postgres --link mydbpostgres:postgres -e "DB_NAME=newbonitadb" -e "DB_USER=newbonitauser" -e "DB_PASS=newbonitapass" -v "$PWD"/bonita_migration:/opt/bonita/ -d -p 8081:8080 bonita:7.2.4
+	```
+
+	-	If >= 7.3.0
+
+	```console
+	$ docker run --name=bonita_7.3.0_postgres --link mydbpostgres:postgres -e "DB_NAME=newbonitadb" -e "DB_USER=newbonitauser" -e "DB_PASS=newbonitapass" -d -p 8081:8080 bonita:7.3.0
+	```
 
-10.	Launch the migration
+-	Reapply specific configuration if needed, for example with a version >= 7.3.0 :
 
-		./migration.sh
+	```console
+	$ docker exec -ti bonita_7.3.0_postgres /bin/bash
+	```
 
-11.	Launch the new container pointing towards the copy of DB and filesystem
+	```console
+	$ cd /opt/bonita/BonitaBPMCommunity-7.3.0-Tomcat-7.0.67/setup
+	$ ./setup.sh pull
+	$ TENANT_LOGIN=tech_user
+	$ TENANT_PASSWORD=secret
+	$ PLATFORM_LOGIN=pfadmin
+	$ PLATFORM_PASSWORD=pfsecret
+	$ sed -e 's/^#userName\s*=.*/'"userName=${TENANT_LOGIN}"'/' \
+	      -e 's/^#userPassword\s*=.*/'"userPassword=${TENANT_PASSWORD}"'/' \
+	      -i platform_conf/current/tenants/1/tenant_engine/bonita-tenant-community-custom.properties
+	$ sed -e 's/^platform.tenant.default.username\s*=.*/'"platform.tenant.default.username=${TENANT_LOGIN}"'/' \
+	      -e 's/^platform.tenant.default.password\s*=.*/'"platform.tenant.default.password=${TENANT_PASSWORD}"'/' \
+	      -i platform_conf/current/platform_portal/platform-tenant-config.properties
+	$ sed -e 's/^#platformAdminUsername\s*=.*/'"platformAdminUsername=${PLATFORM_LOGIN}"'/' \
+	      -e 's/^#platformAdminPassword\s*=.*/'"platformAdminPassword=${PLATFORM_PASSWORD}"'/' \
+	      -i platform_conf/current/platform_engine/bonita-platform-community-custom.properties
+	$ sed -i -e 's/^#GET|/GET|/' -e 's/^#POST|/POST|/' -e 's/^#PUT|/PUT|/' -e 's/^#DELETE|/DELETE|/' -i platform_conf/current/tenants/1/tenant_portal/dynamic-permissions-checks.properties
+	$ ./setup.sh push
+	```
 
 	```console
-	$ docker run --name=bonita_7.0.3_postgres --link mydbpostgres:postgres -e "DB_NAME=newbonitadb" -e "DB_USER=newbonitauser" -e "DB_PASS=newbonitapass" -v "$PWD"/bonita_7.0.3_postgres:/opt/bonita/ -d -p 8081:8080 bonita:7.0.3
+	$ docker restart bonita_7.3.0_postgres
 	```
 
 For more details regarding Bonita migration, see the [documentation](http://documentation.bonitasoft.com/migrate-earlier-version-bonita-bpm-0).