Monday Jan 14, 2013

Migrating folders and content together in WebCenter Content

In the case of migrating from one WebCenter Content instance to another, there are several different tools within the system to accomplish that migration depending on what you need to move over.

This post will focus on the use case of needing to move a specific set of folders and their contents from one instance to another.  And the folder architecture in this example is Folders_g. Although Framework Folders is the recommended folders component for WebCenter Content 11g PS5 and later, there are still cases where you must still use Folders_g (e.g. WebCenter Portal, Fusion Applications, Primavera, etc).  Or perhaps you are at an older version and Folders_g is the only option.

To prepare, you must first have the FoldersStructureArchive component enabled on both the source and target instances.  If you are on UCM 10g, this component will be available within the CS10gR35UpdateBundle/extras folder.  In addition to enabling the component, there is a configuration flag to set.  By default, the config variable ArchiveFolderStructureOnly is set to false which means content will be exported along with the folders, so that can be left alone.  The config variable AllowArchiveNoneFolderItem is set to true by default which means it will export content both in the folder structure as well as those not selected...or even outside of folders.  Basically, it means you must use the Export Criteria in the archive to control the content to export. In our use case, we only want the content within the folders we select, so the configuration should be set as AllowArchiveNoneFolderItem=false.  Now only content that is in our selected folders will get exported into the archive. This can be set in the General Configuration in the Admin Server.

You will also need to make sure the custom metadata fields on both instances is identical. If they are mismatched, the folders will not import into the target instance correctly. You can use the Configuration Migration Utility to migrate those metadata fields.

Once the component is enabled and configurations set, go to Administration -> Admin Applets -> Archiver and select Edit -> Add... to create a new archive.  

New archive

Now that the archive is established, go back to the browser and go to Administration -> Folder Archiver Configuration.  For the Collection Name, it will default to the local collection.  Change this if your archive is in a different collection.  Then select your Archive Name from the list.

archive select

Expand the folder hierarchy and you can now select the specific folder(s) you want to migrate.  The thing to keep in mind are the parent folders to the ones you are selecting.  If the idea is you want to migrate a certain section of the folder hierarchy to the other server and you want it to be in the same place in the target instance, you want to make sure that the parent folder already exists in the target.  It is possible to migrate a folder and place it within a different parent folder in the target instance, but then you need to make sure you set the import maps correctly to specify the destination folder (more on that later).

Select folders

Once they are selected, click the Add button to save the configuration.  This will add the right criteria to the archive. Now go back to the Archiver applet.  Highlight the archive and select Actions -> Export.  Be sure 'Export Tables' is selected.  Note: If you try using the Preview on either the contents or the Table data, both will show everything and not just what you selected.  This is normal. The filtering of content and folders is not reflected in the Preview. Once completed, you can click on the View Batch Files... button to verify the results.  You should see an entry for the Collections_arTables and one or more for the content items.  

View batches

If you highlight the Collections row and click Edit, you can view and verify the results.

Verify collections table

You can do the same for the document entries as well.

Once you have the archive exported, you need to transfer it from the source to the target instance. If I don't have the outgoing providers set up to do the transfer, I sometimes cheat and copy over the archive folder from <cs instance dir>\archives\{archive name} directly over to the other instance.  Then I manually modify the collection.hda file on the target to let it know about the archive:

@ResultSet Archives
2
aArchiveName
aArchiveDescription
exportfoldersandfiles
Export some folders and files

@end

Or if I have Site Studio installed and my archive is fairly small, I'll take the approach described in this earlier post.

Before you import the archive on the target, you need to make sure the folders will be going into the right "parent" folder. If you've already migrated the parent folder to your folders to the target instance, then the IDs should match between instances and you should not have to do any import mappings. But if you are migrating the folders and the parent IDs will be different on the target (such as the main Contribution Folders or WebCenter Spaces root folder), then you will have to map those values.

First, to check what the folder's ID is, you can simply place your mouse over the link to the particular folder to get it's ID.  It will be identified as dCollectionID in the URL.  Do this on both the source and target instances.

Get dCollectionID

In this example, the dCollectionID on the source instance for the parent folder (Contribution Folders) is 826127598928000002.  On the target instance, its Contribution Folders ID is 838257920156000002.  So that means when the top level 'Product Management' folder in our archive moves over, the ID that specifies the ParentID needs to be mapped to the new value. So now we have all the information we need for the mapping.

Go to the Archiver on the target instance and highlight the archive.  Click on the Import Maps tab and then on the Table tab.  Double-click on the folder and then expand they date entry.  It should then show the Collections table.

Import tables

Click on the Edit button for the Value Maps. For the Input Value, you want to enter the value of the dCollectionID of the parent folder from the source instance. In our example, this is 826127598928000002. For the Field, you want to change this to be the dParentCollectionID. And for the Output Value, you want this to be the dCollectionID of the parent folder in the target instance.  In our example, this is 838257920156000002.  Click the Add button.  

Value map

This will now map the folders into the correct location on target.

The archive is now ready to be imported.  Click on Actions -> Import and be sure the 'Import Tables' check-box is checked. To check for any issues, be sure to go to the logs at Administration -> Log Files -> Archiver Logs.

And that's it.  Your folders and files should now be migrated over.

Wednesday Jun 08, 2011

Importing and exporting archives as zip files in UCM

Archive ZipOne of the features of Site Studio is the ability to backup and restore websites.  It takes all of the assets associated with the website and combines them into a backup directory that is stored on the server and can be downloaded as a zip if needed.  When it comes time to restore, you simply choose that backup from the server or upload the zip file saved earlier.  The mechanism that Site Studio is using in the background is simply a specialized Archiver process.  An archive is defined dynamically with the proper export criteria to grab the site assets and they are exported to that backup directory.  Then when you request a download of that backup, UCM zips that standard archive directory and delivers the zip file to the client browser.

Well, it turns out that this ability to download and upload zipped archives does not have to be for just Site Studio sites.  You can do this for regular content archives as well. 

First, when you go to the Archiver applet, you're taken to the default collection of archives.  In the menu, go to Options -> Open Archive Collection.  There you should see another one with the name "<instance name>_sitestudiobackupcollection".  Select that collection and click Open. 

Archive Collection

This collection got created when Site Studio was installed and is where site backups are archived. And even if you aren't using Site Studio at all, as long as you have it enabled, this feature will be available. If you've done backups or restores already, you'll see those listed. Now that you have the collection open, you can add your new archives here.  You can create those just as you normally would.  

archive list

Now perform the archive Export process.  The content/table data will then get exported to the collection location on the server.

To download the archive, go to Administration ->; Site Studio Administration -> Backup and Restore.   Click the Managed Archives button.  You should now see your archive in the list.  

Manage Backups

With the Actions icon, select 'Download backup archive as ZIP'.  This will zip up the archive and allow you to download it locally.  Note, large archives may take a while to zip up and may time out if too large.  For those types of archives, I'd recommend setting up the traditional ways of migrating the archive.

Now that you have your archive, you can just as easily import it into your target instance.  On that instance, go to  Administration -> Site Studio Administration -> Backup and Restore.  In the Upload Archive section, browse to your saved archive and click Upload Archive.  You'll then be taken to the archive information screen.   

Archive Information

On the Actions menu, select 'Restore backup archive contents'.  This will now import the archived documents.  If you wish to include some import mappings, you can simply go to the Archiver applet and set up the mappings there and do the import right from the applet.

About

Kyle Hatlestad is a Solution Architect in the WebCenter Architecture group (A-Team) who works with WebCenter Content and other products in the WebCenter & Fusion Middleware portfolios. The WebCenter A-Team blog can be found at: https://blogs.oracle.com/ ateam_webcenter/

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today