Workspaces are enabled at the time of setting up the environment but sometimes if business makes late decision and if we need to enable workspace at later stage, In my project I have done the same and get into few troubleshooting that I think it would be good to share as below.
Prerequisites: Before you enable Workspaces in the WebSphere Commerce development environment, ensure that:
WebSphere Commerce Developer is installed and not configured with Apache Derby because workspaces are not supported only on DB2 or Oracle DB.
Step -1: Go to the WCDE_installdir/workspace/WC/xml/config/wc-server.xml.
Step -2: Open wc-server.xml and enable WorkspaceChangeHistoryEnabled falg so that it becomes <WorkspaceChangeHistoryEnabled enable="true"/>.
Step -3: Save and close the file. Then, restart the server. And exit the development environment.
Step -4: Enable the Workspace by using following bat file:
For Example - C:/WCDE_ENT70/bin/enableContentManagement.bat 5
This will create 5 number of workspaces schema for both Read schema that is prefixed with WCR and Write schema prefixed with WCW
Step -5: Enabling Content management for Custom table:
Use the update workspaces table script when you make schema changes to a table and need to update your workspaces schema to include the changes. This is required for all the custom tables which are participated in the workspaces managements:
WCDE_installdir/bin>updateWorkspacesTable.bat CONTENT_MANAGED <CUSTOME TABLE NAME>
For Example - UpdateWorkspacesTable.bat XCATGPENREL CONTENT_MANAGED
Step -6: updating work spaces schema:
Use the update workspaces schema script when you change your base schema and need to update your workspaces schema to include the changes
Follow steps 7 and 8 to setup SOLR for workspaces:
Step -7: if search setup is already available than skip this step
Execute setupSearchIndex.bat -masterCatalogId <master catalog id>
For Example - setupSearchIndex.bat -masterCatalogId 10001
Step -8: Run preprocess and build index as below to synchronize changes between the base index and workspace index
8a) di-preprocess.bat <full path> -instance instance_name -dbuser dbuser -dbuserpwd dbuserpwd -workspace workspaceId
For Example - di-preprocess.bat C:\IBM\WCDE_ENT70\search\pre-processConfig\MC_10001\DB2\ -instance inst1 -dbuser db2admin -dbuserpwd passw0rd -workspace WCW101
8b) di-buildindex.bat -masterCatalogId 10001