IBM WebSpher
Portal 7.0 Database Migration
This document
includes my Experience how to transfer Portal Derby Data base to Db2
9.7.2 in Windows Environment .
This document
not includes :
- Installation of the Portal server 7.0
- Installation of the Db2 9.7.2
Migration of
Derby 9.7.2
Default status
of the portal database status is
It have one
database by default its name is wpsdb
and it have 6 schemas .
• Release,
Likeminds, Feedback: These schemas store data
of Pages, Portlets, Portlet instances, Themes, Templates,
Personalization rules and Policies. This data is not
modified during
the portal runtime.
• Customization:
This schema stores information specific to users (for example
PortletData).
• Community,
Jcr: These schemas store data of shared
documents and resources. This
data will be
modified during runtime.
Note point for
DB2
Before
installing DB2 for IBM i, log in with a user ID that has
administrative authority.
This user
should have the following specifications:
Belong to the
local Administrator group
Act as part of
the operating system
Have
permissions to create a token object
Have
permissions to replace a process level token
To edit user
rights:
For the first
two specifications: Click Start -> Programs -> Administrative
Tools -> Computer Management -> Local Users and Groups.
For the last
four specifications: Click Start -> Programs -> Administrative
Tools -> Local Security Policy. Then, click Local Policies ->
User Rights Assignment.
I am mentioning
this because this was the most critical task for me to handling with
DB2 user and its permissi
- You can transfer these schema to all new database or just create one data base and create 6 schema and transfer the data in that .
- Portal Ends configuration Ends
- Edit the WebSphere\wp_profile\ConfigEngine\properties\wkplc_dbtype.properties file and make the following changes:
- db2.DbLibrary=C:/IBM/DB2/java/db2jcc4.jar;C:/IBM/DB2/java/db2jcc_license_cu.jar
- db2.JdbcProviderName=wpdbJDBC_db2
- here location of these jar file may differ according to your DB2 installation file . These file must be present in you local system if your Db2 at remote location .
- Edit the WebSphere\wp_profile\ConfigEngine\properties\wkplc_dbdomain.properties file and make the following changes:
- feedback schema
- feedback.DbType=db2
- feedback.DbName=wps7db
- feedback.DbSchema=FEEDBACK
- feedback.DataSourceName=wpdbDS_db2
- feedback.DbUrl=jdbc:db2://mydbserver.ibm.com:50000/wps7db:returnAlias=0;
- feedback.DbUser=db2admin
- feedback.DbPassword=Passw0rd
- feedback.DbRuntimeUser=db2admin
- feedback.DbRuntimePassword=Passw0rd
- likeminds schema
- likeminds.DbType=db2
- likeminds.DbName=wps7db
- likeminds.DbSchema=likeminds
- likeminds.DataSourceName=wpdbDS_db2
- likeminds.DbUrl=jdbc:db2://mydbserver.ibm.com:50000/wps7db:returnAlias=0;
- likeminds.DbUser=db2admin
- likeminds.DbPassword=Passw0rd
- likeminds.DbRuntimeUser=db2admin
- likeminds.DbRuntimePassword=Passw0rd
- release schema
- release.DbType=db2
- release.DbName=wps7db
- release.DbSchema=release
- release.DataSourceName=wpdbDS_db2
- release.DbUrl=jdbc:db2://mydbserver.ibm.com:50000/wps7db:returnAlias=0;
- release.DbUser=db2admin
- release.DbPassword=Passw0rd
- release.DbRuntimeUser=db2admin
- release.DbRuntimePassword=Passw0rd
- community schema
- community.DbType=db2
- community.DbName=wps7db
- community.DbSchema=community
- community.DataSourceName=wpdbDS_db2
- community.DbUrl=jdbc:db2://mydbserver.ibm.com:50000/wps7db:returnAlias=0;
- community.DbUser=db2admin
- community.DbPassword=Passw0rd
- community.DbRuntimeUser=db2admin
- community.DbRuntimePassword=Passw0rd
- customization schema
- customization.DbType=db2
- customization.DbName=wps7db
- customization.DbSchema=customization
- customization.DataSourceName=wpdbDS_db2
- customization.DbUrl=jdbc:db2://mydbserver.ibm.com:50000/wps7db:returnAlias=0;
- customization.DbUser=db2admin
- customization.DbPassword=Passw0rd
- customization.DbRuntimeUser=db2admin
- customization.DbRuntimePassword=Passw0rd
- jcr schema
- jcr.DbType=db2
- jcr.DbName=wps7db
- jcr.DbSchema=jcr
- jcr.DataSourceName=wpdbDS_db2
- jcr.DbUrl=jdbc:db2://mydbserver.ibm.com:50000/wps7db:returnAlias=0;
- jcr.DbUser=db2admin
- jcr.DbPassword=Passw0rd
- jcr.DbRuntimeUser=db2admin
- jcr.DbRuntimePassword=Passw0rd
- Some time also require to change the following properties
- customization.DBA.DbUser=db2inst1
- customization.DBA.DbPassword=password
- (Optional) Edit the following properties in /ConfigEngine/properties/wkplc_comp.properties if you intend to transfer the Portal databases from any database other than Derby. NOTE: These values by default are set for the out-of-the-box derby configuration. If you are configuring Portal for an external database for the first time, you should NOT modify these properties. However if you have already configured Portal for another database, such as Oracle, and you want to transfer to DB2, then update the source properties to reflect your current database settings.
source.domain.DbType
- The type of database you are currently configured to. This is
'derby' by default.
source.domain.DbName
- The name of the database this domain is currently using.
source.domain.DbSchema
- The current schema identifier for objects within the database for
this domain.
source.domain.DataSourceName
- The name of the datasource that is currently in use in the
WebSphere Application Server configuration.
source.domain.DbUrl
- The url currently used to access your database.
source.domain.DbUser
- The name of the user that currently accesses this database.
source.domain.DbPassword
- The password of the source DbUser.
in this guide,
we will not be editing these properties.
4.Notice
mention that use form which you logging to the system and must have
sufficient privilege as administrator
- Database level activity
- before migration you have to setup a database at DB2 end this can be achieved by two ways
- Automatic database setup :
- make sure you portal server and application server is stop .
- Stop both the server1 and WebSphere_Portal servers:
- ./stopServer.bat server1 -username admin_userid -password admin_password
- ./stopServer.bat WebSphere_Portal -username admin_userid -password admin_password
- create database in Db2 say wps7db
- Execute step 5 or 6
- Automatically Creating Users, Granting Permissions, and Creating Java Content Repository Table Spaces
- You must create your DB2 for IBM i databases before running the configuration task in this topic.
- As an alternative to automatically setting up the database, you can manually set up your database by referring to the link in the related tasks section of this topic.
- (In command prompt )Change to the directory wp_profile_root/ConfigEngine
- To create the database users, type the following command:
- Note:
- The task setup-database assigns the minimum database privileges to the database configuration and runtime database users.
- ./ConfigEngine.sh setup-database -DwasPassword=password
This topic provides instructions on automatically setting up your database using the ConfigEngine task to create users, grant permissions, and create Java Content Repository table spaces.
- here I put query for different data base so modify accordingly
- Run the following commands on the DB2 server system to configure the DB2 database instance:
- here note that query for all different data base so make changes accordingly in your properties file .
- DB2 Version 9
- db2set DB2_RR_TO_RS=YES
- db2set DB2_EVALUNCOMMITTED=YES
- db2set DB2_INLIST_TO_NLJN=YES
- db2 "UPDATE DBM CFG USING query_heap_sz 32768"
- db2 "UPDATE DBM CFG USING maxagents 500"
- db2 "UPDATE DBM CFG USING sheapthres 50000"
- Run the following commands on the DB2 server system to create the necessary databases:
- Replace dbname with the actual name of the database.
- I. create release db:
- db2 "CREATE DB release using codeset UTF-8 territory us PAGESIZE 8192"
- db2 "UPDATE DB CFG FOR release USING applheapsz 4096"
- db2 "UPDATE DB CFG FOR release USING app_ctl_heap_sz 1024"
- db2 "UPDATE DB CFG FOR release USING stmtheap 32768"
- db2 "UPDATE DB CFG FOR release USING dbheap 2400"
- db2 "UPDATE DB CFG FOR release USING locklist 1000"
- db2 "UPDATE DB CFG FOR release USING logfilsiz 4000"
- db2 "UPDATE DB CFG FOR release USING logprimary 12"
- db2 "UPDATE DB CFG FOR release USING logsecond 20"
- db2 "UPDATE DB CFG FOR release USING logbufsz 32"
- db2 "UPDATE DB CFG FOR release USING avg_appls 5"
- db2 "UPDATE DB CFG FOR release USING locktimeout 30"
- db2 "UPDATE DB CFG FOR release using AUTO_MAINT off"
- II. create community db
- db2 "CREATE DB community using codeset UTF-8 territory us PAGESIZE 8192"
- db2 "UPDATE DB CFG FOR community USING applheapsz 4096"
- db2 "UPDATE DB CFG FOR community USING app_ctl_heap_sz 1024"
- db2 "UPDATE DB CFG FOR community USING stmtheap 32768"
- db2 "UPDATE DB CFG FOR community USING dbheap 2400"
- db2 "UPDATE DB CFG FOR community USING locklist 1000"
- db2 "UPDATE DB CFG FOR community USING logfilsiz 4000"
- db2 "UPDATE DB CFG FOR community USING logprimary 12"
- db2 "UPDATE DB CFG FOR community USING logsecond 20"
- db2 "UPDATE DB CFG FOR community USING logbufsz 32"
- db2 "UPDATE DB CFG FOR community USING avg_appls 5"
- db2 "UPDATE DB CFG FOR community USING locktimeout 30"
- db2 "UPDATE DB CFG FOR commun using AUTO_MAINT off"
- III. creating customization db
- db2 "CREATE DB customization using codeset UTF-8 territory us PAGESIZE 8192"
- db2 "UPDATE DB CFG FOR customization USING applheapsz 4096"
- db2 "UPDATE DB CFG FOR customization USING app_ctl_heap_sz 1024"
- db2 "UPDATE DB CFG FOR customization USING stmtheap 32768"
- db2 "UPDATE DB CFG FOR customization USING dbheap 2400"
- db2 "UPDATE DB CFG FOR customization USING locklist 1000"
- db2 "UPDATE DB CFG FOR customization USING logfilsiz 4000"
- db2 "UPDATE DB CFG FOR customization USING logprimary 12"
- db2 "UPDATE DB CFG FOR customization USING logsecond 20"
- db2 "UPDATE DB CFG FOR customization USING logbufsz 32"
- db2 "UPDATE DB CFG FOR customization USING avg_appls 5"
- db2 "UPDATE DB CFG FOR customization USING locktimeout 30"
- db2 "UPDATE DB CFG FOR customization using AUTO_MAINT off"
- IV. creating jcr db
- db2 "CREATE DB jcrdb using codeset UTF-8 territory us PAGESIZE 8192"
- db2 "UPDATE DB CFG FOR jcr USING applheapsz 4096"
- db2 "UPDATE DB CFG FOR jcr USING app_ctl_heap_sz 1024"
- db2 "UPDATE DB CFG FOR jcr USING stmtheap 32768"
- db2 "UPDATE DB CFG FOR jcr USING dbheap 2400"
- db2 "UPDATE DB CFG FOR jcr USING locklist 1000"
- db2 "UPDATE DB CFG FOR jcr USING logfilsiz 4000"
- db2 "UPDATE DB CFG FOR jcr USING logprimary 12"
- db2 "UPDATE DB CFG FOR jcr USING logsecond 20"
- db2 "UPDATE DB CFG FOR jcr USING logbufsz 32"
- db2 "UPDATE DB CFG FOR jcr USING avg_appls 5"
- db2 "UPDATE DB CFG FOR jcr USING locktimeout 30"
- db2 "UPDATE DB CFG FOR jcr using AUTO_MAINT off"
- V. creating feedback db
- db2 "CREATE DB fdbkdb using codeset UTF-8 territory us PAGESIZE 8192"
- db2 "UPDATE DB CFG FOR feedback USING applheapsz 4096"
- db2 "UPDATE DB CFG FOR feedback USING app_ctl_heap_sz 1024"
- db2 "UPDATE DB CFG FOR feedback USING stmtheap 32768"
- db2 "UPDATE DB CFG FOR feedback USING dbheap 2400"
- db2 "UPDATE DB CFG FOR feedback USING locklist 1000"
- db2 "UPDATE DB CFG FOR feedback USING logfilsiz 4000"
- db2 "UPDATE DB CFG FOR feedback USING logprimary 12"
- db2 "UPDATE DB CFG FOR feedback USING logsecond 20"
- db2 "UPDATE DB CFG FOR feedback USING logbufsz 32"
- db2 "UPDATE DB CFG FOR feedback USING avg_appls 5"
- db2 "UPDATE DB CFG FOR feedback USING locktimeout 30"
- db2 "UPDATE DB CFG FOR feedback using AUTO_MAINT off"
- VI. creating likeminds db
- db2 "CREATE DB lmdb using codeset UTF-8 territory us PAGESIZE 8192"
- db2 "UPDATE DB CFG FOR likeminds USING applheapsz 4096"
- db2 "UPDATE DB CFG FOR likeminds USING app_ctl_heap_sz 1024"
- db2 "UPDATE DB CFG FOR likeminds USING stmtheap 32768"
- db2 "UPDATE DB CFG FOR likeminds USING dbheap 2400"
- db2 "UPDATE DB CFG FOR likeminds USING locklist 1000"
- db2 "UPDATE DB CFG FOR likeminds USING logfilsiz 4000"
- db2 "UPDATE DB CFG FOR likeminds USING logprimary 12"
- db2 "UPDATE DB CFG FOR likeminds USING logsecond 20"
- db2 "UPDATE DB CFG FOR likeminds USING logbufsz 32"
- db2 "UPDATE DB CFG FOR likeminds USING avg_appls 5"
- db2 "UPDATE DB CFG FOR likeminds USING locktimeout 30"
- db2 "UPDATE DB CFG FOR likeminds using AUTO_MAINT off"
- Create the following tablespaces in your JCR database. If you are using one database for all domains, then create these tablespaces in that database:
- is step is only required for the IBM Java Content Repository database (jcrdb).
- * jcrdb is the name of the database used to store user data and objects
- * jcr is the database user for jcrdb
- Note: This value can be replaced with any ID that has administrative authority.* dbpassword is the password for jcrdb
- Db2 Scripts
- db2 "CONNECT TO jcrdb USER db2inst1 USING password"
- db2 "CREATE BUFFERPOOL ICMLSFREQBP4 SIZE 1000 PAGESIZE 4 K"
- db2 "CREATE BUFFERPOOL ICMLSVOLATILEBP4 SIZE 8000 PAGESIZE 4 K"
- db2 "CREATE BUFFERPOOL ICMLSMAINBP32 SIZE 8000 PAGESIZE 32 K"
- db2 "CREATE BUFFERPOOL CMBMAIN4 SIZE 1000 PAGESIZE 4 K"
- db2 "CREATE REGULAR TABLESPACE ICMLFQ32 PAGESIZE 32 K MANAGED BY SYSTEM USING ('ICMLFQ32') BUFFERPOOL ICMLSMAINBP32"
- db2 "CREATE REGULAR TABLESPACE ICMLNF32 PAGESIZE 32 K MANAGED BY SYSTEM USING ('ICMLNF32') BUFFERPOOL ICMLSMAINBP32"
- db2 "CREATE REGULAR TABLESPACE ICMVFQ04 PAGESIZE 4 K MANAGED BY SYSTEM USING ('ICMVFQ04') BUFFERPOOL ICMLSVOLATILEBP4"
- db2 "CREATE REGULAR TABLESPACE ICMSFQ04 PAGESIZE 4 K MANAGED BY SYSTEM USING ('ICMSFQ04') BUFFERPOOL ICMLSFREQBP4"
- db2 "CREATE REGULAR TABLESPACE CMBINV04 PAGESIZE 4 K MANAGED BY SYSTEM USING ('CMBINV04') BUFFERPOOL CMBMAIN4"
- db2 "CREATE SYSTEM TEMPORARY TABLESPACE ICMLSSYSTSPACE32 PAGESIZE 32 K MANAGED BY SYSTEM USING ('icmlssystspace32') BUFFERPOOL ICMLSMAINBP32"
- db2 "CREATE SYSTEM TEMPORARY TABLESPACE ICMLSSYSTSPACE4 PAGESIZE 4 K MANAGED BY SYSTEM USING ('icmlssystspace4') BUFFERPOOL ICMLSVOLATILEBP4"
- db2 "DISCONNECT jcrdb"
- db2 "TERMINATE"
- Configure JCR Collation(This section is optional.)
- This section is only needed if you are using Web Content Management (WCM). These steps enable JCR Collation support, designed to help improve performance with WCM. If you are not using WCM, it will not hurt to complete these steps, but again, it is not required.
- Copy the following files from the WebSphere Portal server to a temporary directory on the DB2 server:
- <PortalServer>/jcr/prereq.jcr/config/collation.jar
- <PortalServer>/jcr/prereq.jcr/config/registerCollationUDFTemplate.sql
- From the DB2 server, open a terminal window and change directories to:
- <db2_instance_home>/sqllib/function
- From the DB2 server, Execute the following command:
- jar -xvf <temporary location>/collation.jar
- NOTE: In order for the above command to work, you must have java installed on the DB2 server and the JAVA_HOME environment variable set to the java root directory.
- From the DB2 server, edit the <temporary location>/registerCollationUDFTemplate.sql file in a text editor.
- Change all SCHEMA references in this file to the value you set for jcr.DbSchema in wkplc_dbdomain.properties. In this case, the schema value is 'jcr'.
- Change the following line:
- "VALUE VARCHAR(32672)," to "VALUE VARCHAR(100),"
"RETURNS VARCHAR(32672) FOR BIT DATA" to "RETURNS VARCHAR(100) FOR BIT DATA" - Save the registerCollationUDFTemplate.sql file
- From the DB2 server, connect to the JCR database by executing the following command in a terminal window:
- db2 connect to jcr user db2inst1 using password
- From the same terminal window, execute the SQL script by running the following command:
- db2 -tvf <temporary location>/registerCollationUDFTemplate.sql
- Disconnect from the JCRDB and restart the DB2 instance.
- Configure WebSphere tPortal with DB2
- you can transfer data base by two ways you can use any one of them .1 by using confiEngine task (scripts ) or 2 by portal wizard follow one of these
- Scripts
- In this section, you will transfer the WebSphere Portal server data that exists in the current database (Derby by default) to the DB2 server. This is accomplished by a ConfigEngine script called 'database-transfer'. This script does all of the following:
- Connects to the target database (DB2 in this case) and drops all objects within them to ensure we have a clean database to transfer to.
- Creates the necessary tables, indexes, etc in the target databases for each domain.
- Transfers the data from the source database (Derby by default) to the target database (DB2) for each domain.
- Creates a JDBC Provider and datasources in the WebSphere Application Server configuration
- Maps the data sources to the appropriate applications. For example the release, customization, community and jcr datasources are mapped to wps.ear.
- From the Portal server, and from a terminal window (command prompt), change directories to wp_profile/ConfigEngine
- Execute the following ConfigEngine scripts to validate the database properties:
- Windows:
- ConfigEngine.bat validate-database-driver -DWasPassword=password
- ConfigEngine.bat validate-database-connection -DWasPassword=password
- UNIX:
- ./ConfigEngine.sh validate-database-driver -DWasPassword=password
- ./ConfigEngine.sh validate-database-connection -DWasPassword=password
- Execute the following ConfigEngine script to transfer the database from Derby to DB2:
- IMPORTANT: Do not run this script as a background process. The script may hang during the 'action-validate-database' sub-task if executed as a background process.
- Windows: ConfigEngine.bat database-transfer -DPortalAdminPwd=password -DWasPassword=password
- UNIX: ./ConfigEngine.sh database-transfer -DPortalAdminPwd=password -DwasPassword=password
Note:
To
select specific database domains to transfer, modify the
-DTransferDomainList specified in the command to include only the
domains that you want to transfer. For example, to transfer only the
JCR domain you can enter the following command:
./ConfigEngine.sh
database-transfer -DTransferDomainList=jcr -DWasPassword=password
If
you have been storing data in Apache® Derby for a long time,
database transfer could fail with OutOfMemory exceptions. If database
transfer fails, add the following property to the command in this
step:
./ConfigEngine.sh
database-transfer -DDbtJavaMaxMemory=1536M -DWasPassword=password
- By using wizard
Open the portal config wizard from
C:\IBM\WebSphere\wp_profile\PortalServer\wizard\configwizard.bat,
this wizard will walk you through all required configuration to
transfer the db (most of the screens are self-explanatory).
Data base transfer done .
- After the database-transfer completes, change directories to wp_profile/bin and execute the following command to start the Portal server:
- Windows: startServer.bat WebSphere_Portal
- UNIX: ./startServer.sh WebSphere_Portal
- Clustered environments only. If you have performed these steps in a clustered environment, you must also complete the following steps:
- Copy the wp_profile_root/PortalServer/jcr/lib/com/ibm/icm/icm.properties file from the primary node and replace the icm.properties file on each secondary node with the new file from the primary node.
- Restart the secondary cluster members.
- Updating the Database Configuration to Support Large Files (Web Content Management Only)If you are using Web Content Management, you must update the database configuration to support large files. Do this by setting thefullyMaterializeLobData property in the WebSphere Application Server administrative console.
- Note:
- You only need to perform these steps if you are using Web Content Management.
- Log in to the WebSphere Application Server administrative console.
- Click Resources -> JDBC -> Data sources.
- Select all scopes (the default setting) or select a specific cell, node, or node/server.
- Select the scope that corresponds to your instance of WebSphere Portal.
- The view refreshes.
- Select the name of the data source that is defined in wkplc_dbdomain.properties for the JCR database domain.
- The default data source is wpdbDS.
- Click Custom properties.
- Ensure that the fullyMaterializeLobData property is set to false.
- Optional: If you specified a runtime database user for the dbdomain.DbRuntimeUser parameter, that user must have sufficient database user privileges. To grant the database user privileges, choose either the manual steps or the command line steps:
- Complete these steps to manually grant database user privileges:
- Copy the appropriate template files to a work directory. Choose one of the following template files:
- createRuntimeRoleForDifferentSchema.sql if the name of the database user and the schema name are not the same.
- createRuntimeRoleForSameSchema.sql if the name of the database user and the schema name are the same.
- JCR database domain: For the JCR database domain, you must also copy grantExtendedPermissionsToRuntimeRole.sql.
- Locate these files in the following directories:
- PortalServer_root\base\wp.db.impl\config\templates\setupdb\dbms\domain
- PortalServer_root\pzn\prereq.pzn\config\templates\setupdb\dbms\domain
- Replace all placeholder values with the values as defined in wkplc_dbdomain.properties. Placeholder values are surrounded by the character @.
- Run these statements.
- Complete these steps to grant database user privileges with the ConfigEngine task:
- Ensure the database administrator user ID is specified for domain.DBA.DbUser inwp_profile_root\ConfigEngine\properties\wkplc_dbdomain.properties. For example, domain.DBA.DbUser=dbadmin.
- Run the following task:
- ./ConfigEngine.sh grant-runtime-db-user-privileges -DtransferDomainList=comma_separated_list_of_domains
No comments:
Post a Comment