Proactive insights, news and tips from Oracle WebLogic Server Support. Learn Oracle from Oracle.

  • October 28, 2015

Partition Import/Export

This blog try to answer few questions faced during export/import of a partition

For a "Export/Import Documentation" please refer to http://docs.oracle.com/middleware/1221/wls/WLSMT/export_import.htm#WLSMT636

How to know the status of exportPartition, importPartition WLST commands

wlst command for exporting is

exportPartition(partitionName, expArchPath, [includeAppsNLibs], [keyFile])

This carries out the exportPartition task and returns the status of the exportPartition operation in an object

The status are as follows

  1. NOT_STARTED = -1
  2. STARTED = 1
  3. FINISHED = 2
  4. FAILED = 3

To see the status of exportPartition whether it succeeded or not one must capture the output of the command in an object, like

expPartStatus = exportPartition('partition1','/home/partitionadmin/exportedPartitions')
while (expPartStatus.getState() != 2 and expPartStatus.getState() != 3):
if(expPartStatus.getState() == 3):
raise expPartStatus.getError()

As we can see that the returned object has 2 methods getState() and getError() , with the names that are self descriptive.

getError() actually returns an java Exception object so one could invoke all methods available for java.lang.Exception  object like


to print the stack trace.

Similarly this could be used for importPartition as well.

How to use user keys for encryption of secure attributes during exportPartition

Sometimes it is desired that the user encrypt secure attributes using their own keys during exportPartition, which they could then re-use to decrypt the secure attributes during importPartition

exportPartition, takes in an optional String argument that specifies the location of the file in which the user key is specified in plain text


 cat /home/partitionadmin/exportPartition/userkey

Now one could use this file to encrypt secure attributes during exportPartition

expPartStatus = exportPartition('partition1','/home/partitionadmin/exportPartition',true,'/home/partitionadmin/exportPartition/userkey')

 and during importPartition use the same key to decrypt the attributes

impPartStatus = importPartition('/home/partitionadmin/exportPartition/partition1.zip',keyfile='/home/partitionadmin/exportPartition/userkey')

How to resolve ResourceGroupTemplate Name conflicts during importPartition

It is quite possible that during importing a partition into domain, the domain already has a ResourceGroupTemplate with the same name as the one being imported. In that case one needs to answer the question which ResourceGroupTemplate should the imported Partition use.

The answer is it depends what the user wants.

  1. if the user figures out that the existing ResourceGroupTemplate in the domain has all the resources that the importedPartition needs, then the user can skip importing ResourceGroupTemplate by setting the createNew argument to false explicitly.
    1. impPartStatus = importPartition('/home/partitionadmin/exportPartition/partition1.zip',createNew=false)
  2. if the user decides that the existing ResourceGroupTemplate is not suitable for the partition being imported, then user can call importPartition by setting createNew argument to true. This will create a new ResourceGroupTemplate with the a new name by adding geometrically increasing numbers at the end of the ResourceGroupTemplate name, for e.g. if the existing ResourceGroupTemplate name is "cokeRGT', the new ResourceGroupTemplate will be created with the name "cokeRGT1" and the imported partition will reference this new ResourceGroupTemplate.
    1. impPartStatus = importPartition('home/partitionadmin/exportPartition/partition1.zip',createNew=true)



Join the discussion

Comments ( 2 )
  • guest Tuesday, March 1, 2016

    When I do an import from console, I get this

    Import of the domain partition failed. java.lang.NullPointerException:

    And there are not other information on the logs.

  • guest Tuesday, March 1, 2016

    sorry cannot say much went wrong

    But can you try to un target the virtual targets in the import domain and try,

    Like the vt in the domain where partition was being imported should have no targets assigned to it

    And then try to import the partition (assuming partition is using the vt referenced above )

    After import you can assign targets to vt and start the partition.

Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.