Monday 19 January 2015

WebCenter Content Replication

I currently have a WebCenter Portal installation that uses the Content Presenter task flow extensively to display links to documents stored in WebCenter Content. This content was previously being manually uploaded/migrated between environments which resulted in the same folders/documents existing but with different internal IDs for each environment. 

Since the Content Presenter references WebCenter Content using these internal IDs, any Content Presenters needed to be manually reconfigured to use the different IDs in each environment and WebCenter Portal could not be automatically deployed/migrated.

After some reading, I found that automated replication of WebCenter Content via the Archiver tool was the way to go. This was way more complicated then I expected (as UCM tends to be) so I compiled the below overview of what is involved in setting this up.

Server Configuration

Before content replication can be configured, the source and target WebCenter Content servers both need to be configured as per below:

Enable Trash

So that deleted folders/content can be replicated, you need to enable Trash on both the source and target servers. If Trash is enabled, then any deleted folders/content are simply not included in an export, and therefore the target server is not notified of their removal.

To configure Trash:
  1. Login to the content server as an admin
  2. Expand Administration and select Folder Configuration
  3. Click the System Folder Configuration button
  4. Click the disabled, grey, circle icon beside Trash
  5. Click Allow <user> to Mark Modified Folders

Configure the FolderStructureArchive Component

By default, the Archiver tool will only export content, and not the folders/collections storing the content. This FolderStructureArchive is used to handle folders, but it is not enabled by default.

This component needs to be enabled on the source (pushing) WebCenter Content server, but I like to enable the same components across all of my WebCenter installs, so I completed the below on both the source and target servers:
  1. Login to the content server as an admin
  2. Expand Administration and select Admin Server -> Component Manager
  3. Select the advanced component manager link at the top of the pages
  4. Under the Disabled Components list select FolderStructureArchive
  5. Click the Enable button
  6. Expand Administration and select Admin Server -> General Configuration
  7. In the Additional Configuration Variables text box add the following line.
    • AllowArchiveNoneFolderItem=false
  8. Click Save

Define the Outgoing Provider(s)

To allow your source server to be able to push to a target server, the target server must be defined as an outgoing provider:
  1. Login to the Source content server as an admin
  2. Expand Administration and select Providers
  3. Under the Create a New Provider heading, click the Add link beside the outgoing provider type
  4. Provide the relevant values for the following properties (using Test as an example):
    •  Provider Name: <EnvironmentName> (e.g. Test)
    • Provider Description: The WebCenter Content Test Environment
    • Server Host Name: server.host.name
    • Server Port: 4444
    • Instance Name: serverinstancename
    • Relative Web Root: cs
  5. Leave everything else as default, and click Add
NOTE: I also defined the source server as an Outgoing Provider of the target server using the same instructions as above (using the source server details where appropriate). Please see below for an explanation from Oracle as to why this is a good idea:

"For performance monitoring of a push transfer, you also should set up an outgoing provider from the target (proxied) Content Server instance back to the source (local) Content Server instance. This 'talkback' provider can then notify the source Content Server instance when each transfer is complete. A push transfer will work without the talkback provider, but the source Content Server instance would not be aware of transfer completion or problems."

Restart UCM Managed Server

For the above changes to take effect you need to restart the UCM managed server on the source and target

Archive Creation

Once your content servers are configured, you can then define the exports and imports archives for replication.

Create the Import Archive

An import archive needs to be defined on the target server to accept the export from the source:
  1. Login to the Target content server as an admin
  2. Expand Administration and select Admin Applets
  3. Select Archiver to open the Java applet
  4. Select Options -> Open Archive Collection...
  5. Double click the default collection (should be the same as the instance name)
  6. Click Edit -> Add...
  7. Enter a Archive Name such as "<Env>FoldersAndContentImport" then click OK
Make the target archive 'targetable' so that the source server can send archives to it:
  1. Select the new Archive
  2. Click the Transfer To tab
  3. Under Transfer Options click the Edit button
  4. Select the Is Targetable checkbox
  5. Click OK
  6. Close Archiver

Create the Export Archive

Instead of using Archiver on the source content server to define the archive, we create it using the FolderStructureArchive component we enabled earlier:
  1. Login to the Source content server as an admin
  2. Expand Administration and select Folder Archiver Configuration
  3. Select the default Collection Name (should be the same as the instance name)
  4. Enter a descriptive name e.g. "<Env>FoldersAndContentExport"
  5. Expand and select your relevant folders you wish to export:
    • Contribution Folders - This is where my WebCenter Portal content is stored
    • Trash - Required to allow folder/content deletes
  6. Click Add
Now we have our source archive created, we need to configure its target archive:
  1. Expand Administration and select Admin Applets
  2. Select Archiver to open the Java applet
  3. Select Options -> Open Archive Collection...
  4. If the Target collection you created above is not visible:
    • Click Browse Proxied...
    • Select the target server from the Proxied Server
    • Select the default collection (should be the same as the instance name)
    • Click OK
  5. Double click the default Source collection from the Open Archive Collection... menu
  6. Select the new export archive
  7. Click the Transfer To tab
  8. Under Transfer Destination click the Edit button
  9. Select the default Collection on the target server (should be the same as the target's instance name)
  10. Select the targetable archive which you created a in the previous steps ("<Env>FoldersAndContentImport")
  11. Click OK

Manual Replication

A manual test run of the export, transfer and import process must be run before automation is configured. This is to ensure that any import mappings are done and also make sure everything is hunky dory.

Remove Content From Target

If the same folders and content were already created on the target server manually, then any imports will fail due to duplicate content exceptions. If this is the case, then you first need to remove any duplicate folders/content:
  1. Log on to the Target content server as an admin
  2. Expand Browse Content and select Contribution Folders
  3. Select all child folders and content and select Item Actions -> Delete
  4. Click OK to confirm
You should also remove everything from the Trash:
  1. Log on to the Target content server as an admin
  2. Expand Browse Content and select Trash
  3.  Select all child folders and content and select Item Actions -> Delete
  4. Click OK to confirm

Run the Export/Transfer

Now that you have a fresh target server you can run the export. The export/transfer is completed on the Source server:
  1. Select the Export archive in Archiver
  2. Select Export... from the Actions menu
  3. Accept the defaults and click OK
  4. Wait for the message at the bottom of Archiver to read “Exporting <archive_name> in <collection_name>: Finished”
  5. Select Transfer... from the Actions menu
  6. Wait for the message at the bottom of Archiver to read “Transferring <archive_name> in <collection_name>: Finished”
  7. Close Archiver

Configure Import Maps

In some cases, the internal ID of the root 'Contribution Folders' and 'Trash' folders on the target server is different to the source server. This means that any folders imported would not be placed anywhere viewable since the ID of the parent folder does not exist in the target.

Only after you have an export transferred to the target server (see previous step) can you configure the import mapping:
  1. Open Archiver on the target server
  2. Select the new import Archive you created above
  3. Click the Import Maps tab
  4. Select the Table tab
  5. Expand the Collection Name folder and you should see a dated subfolder that lines up with the export you just performed
  6. Expand this folder and select the child Collections entry
  7. Besides Value Maps click the Edit button
  8. Enter the following details:
    •  Input Value: <id_of_the_source_contribution_folder>
    • Field: dParentCollectionID
    • Input Value: <id_of_the_target_contribution_folder>
  9. Click Add
  10. Enter the following details:
    • Input Value: <id_of_the_source_Trash_folder>
    • Field: dParentCollectionID
    • Input Value: <id_of_the_target_Trash_folder>
  11. Click Add
  12. Click OK

Run the Import

The import is completed on the Target server:
  1. Select the Import archive in Archiver
  2. Select Import... from the Actions menu
  3. Accept the defaults and click OK
  4. Wait for the message at the bottom of Archiver to read “Importing <archive_name> in <collection_name>: Finished”
  5. Close Archiver
You should now verify that everything exists on the target server.

Automatic Replication

NOTE: Automation can only be configured after the initial manual export, transfer and import is completed (see above).

In our environment we want exports from the source server to be manual, but transfers to and imports from the target server to be automatic.

Configure Automatic Transfer

Automatic transfer is configured on the Source server:
  1. Open Archiver
  2. Select the Export archive you created earlier
  3. Select the Transfer To tab
  4. Click the Edit button under the Transfer Options heading
  5. Select the Is Transfer Automated radio button
  6. Click OK
  7. Close Archiver

Configure Automatic Import

Automatic import is configured on the Target server:
  1. Open Archiver
  2. Select the Import archive you created earlier
  3. Select the Replication tab
  4. Click the Register Self button
  5. Close Archiver

Run Replication

  1. Login to the Source content server as an admin
  2. Expand Administration and select Admin Applets
  3. Select Archiver to open the Java applet
  4. Ensure the export archive ("<Env>FoldersAndContentExport") is selected
  5. Select Actions -> Export...
  6. Make sure Export Tables is the only option checked and click OK
  7. Wait for the status at the bottom of the Archiver windows to say "Exporting <archive_name> in <collection_name>: Finished"
  8. Wait for the status at the bottom of the Archiver windows to say "Transferring <archive_name> in <collection_name>: Finished" - This will automatically occur since we made the export "Auto Transferable"
  9. Close Archiver
As per our above configuration, the export from the source server should automatically transfer to the target, and the target server to automatically import any transferred exports. This process can take some time, but once complete, you can verify by:
  1. Login to the Target content server as an admin
  2. Select Browse Content -> Contribution Folders
  3. Check that the new folder and child content exists

Troubleshooting


Checking the Archive Logs

If anything does not appear to work as expected, you can view the archiver logs on either the source or target server:
  1. Login to the content server as an admin
  2. Expand Administration -> Log Files
  3. Select Archiver Logs
  4. Select the relevant date

Unable to Run Java Applets

Initially, I was unable to run any of the WebCenter Content Java applets, and kept receiving an "Application Blocked by Java Security" exception. To rectify this:
  1. Open Java Control Panel (via Control Panel -> Java)
  2. Select Security tab
  3. Click Edit Site List...
  4. Click Add
  5. Enter the exception URL as "[[http://<host_name>]]"
  6. Click OK twice
  7. Restart browser and clear cache
NOTE: Even after clearing caches and restarting browsers this didn't take effect for me and I need to do a full machine restart.

Folders not Appearing

A few times in my trial and error to determine the above process I would encounter the following messages in the Archiver logs:

Skip importing Row: [<content_id>(10EA6634-6FEE-1A1F-E22B-BA6427095FAB,<parent_content_id>,public,0,,,1,1,0,0,1,{ts '2014-09-23 16:52:17.992'},,,,{ts '2014-09-23 16:52:17.992'},,,,,,,,weblogic,weblogic,weblogic,/Contribution Folders/<folder_name/,/9CF69ED3-8A7C-C75B-E3CB-D101CDAEF577/10EA6634-6FEE-1A1F-E22B-BA6427095FAB,/<parent_content_id>/<content_id>] in Table Collections.)

This generally meant on of two things:
  • That the folders actually had been imported, but into a different location, OR
  • The import was attempting to import folders with the same name to the same location
The steps to fix were almost always:
  1. Delete the suspected duplicate folders
  2. Rebuild indexes
  3. Rerun the export/import