navigation

Migration to 12c: Transferring workspace user views from ADF 11g

Migration to 12c: Transferring workspace user views from ADF 11g

by
December 12, 2017

Migration to 12c has become a requirement for many projects. Recently we did an update of the ADF stack for our project and along with this update came the requirement to migrate workspace user views as part of it so they are available when the users start working on the new environment. For clarity, by user views I mean this:

 

migration to 12c

Those are the custom views you can create to allow better filtering of tasks in a workspace. What we wanted was each user working on our application to have the personal views they created available on the migrated version (12c) without needing to re-create them by their own.

At first, I started with searching for a method to migrate all views for all users. This appeared to be possible, but after testing it, it did not work for me. What worked though was migrating all views for a specific user and since we had no more than 20 users needing this, it was an acceptable solution.

There are 3 main steps to follow for this process:

1. Determine the users for which you want migrated views
2. Export views from old environment (11g)
3. Import views to new environment (12c)

Now I can go into details regarding each step:

Determine the users for which you want migrated views

It is possible that you already know exactly for which users to migrate (you have either decided that by yourself or have received a list by someone), but if that is not the case, there is a handy table in the SOA-INFRA schema which can help you. The following query should give you all the information you need for this use case:

select * from WFUSERTASKVIEW;

Each row in the result contains definition for a single view (containing fields like user, view name, view owner, description, creation date… etc). For example you can group by user to see how many views each user has. Some might ask why not just copy the content of this table to the new environment and be done with this, instead of doing this more complicated process for the migration. The problem is that there are foreign keys in WFUSERTASKVIEW to other tables which prevents us from using that method.

Export views from old environment (11g)

Here is the overview of steps for this section:

1. Log in to machine on which you have the old Oracle domain
2. Create a folder there which is going to be used for the View Migration Work
3. Add file migration.properties (will show example) to the created folder, which will determine the views you want to migrate
4. Execute ant script which exports the views (using the configuration provided in the migration.properties file). This creates 2 new files containing the exported information – AttributesMapper.xml and Attributes.xml. Those files will later be used to import the views on the new environment.

migration.properties file should have the following content inside:

You can modify the parameters to suit your needs. Here is documentation from Oracle which explains each attribute from the mentioned above.

As I mentioned above, personally I tried different combinations in order to export all views for all users at the same time, but that worked for me only when I specified the user. Maybe you will have better luck though, so try and see if it works for you :)

After that you need to execute an ant script which will generate the files containing information about the exported views. I found some differences in the parameters regarding 11g and 12c directories though which I will highlight. Here is the ant file for 11g environment:

Ant actually comes with Oracle installation and if it is not already added to PATH on the machine you are working on, it can be found here:

$MW_HOME/modules/org.apache.ant_1.7.1/bin/

You can check the Oracle documentation linked above for more information on the parameters of the ant script. After executing the script, the following 2 files will be created in the location specified on its parameters: Attributes.xml and AttributesMapper.xml.

The Attributes.xml file contains the xml definition of the exported views. Please check carefully after executing the ant script that this file is populated with the appropriate information and the export was successful. AttributesMapper.xml contains the description of the operations you chose to perform using the migration properties file.

Import views to new environment (12c)

Now that we have exported the views from the old environment, here are the things we need to do to import them on the new one:

1. Log in to machine on which you have the new Oracle domain
2. Create a folder there which is going to be used for the View Migration Work
3. Add file migration.properties (this time with import function) to the created folder, which will be used for the importing the migrated views
4. Add the files generated in the previous step with the information about the exported views to the created folder (Attributes.xml and AttributesMapper.xml)
5. Execute ant script which imports the views (using the configuration provided in the migration.properties file)

The migration.properties should be the same as the one in the previous step, with only the operationType being changed to IMPORT:

The ant script file should be configured with attributes matching the new environment. There are some differences in directories between 11g and 12c installation as I mentioned before though, I will highlight those below:

Ant also comes with the installation of oracle here, here is the directory:

$ORACLE_HOME/oracle_common/modules/org.apache.ant_1.9.2/bin/ant

You can check the ant file of course (ant-t2p-worklist.xml) to make sure you are setting the directories correctly.

Now we are ready and after executing the ant script, all views for the specified user in the migration.properties file should be imported to the new environment.

We need to do this whole procedure for every user for which we need view migration… After getting used to the process it will take around a minute or two to finish with one user, but it is still tedious work. Let me know if you have success with this or even better – find a way to migrate all views for all users at the same time!

In addition you can read more about Migration to 12c for ADF SOA application in these useful blogs:

Migration to 12c for ADF SOA application from 11.1.1.7 – part 1
Migration to 12c for ADF SOA application from 11.1.1.7 – part 2

I will appreciate if you leave a comment to share your opinion and experience on the topic.

Tsvetomir Miroslavov

Java EE and Oracle Developer at Dreamix

More Posts - Website

Follow Me:
TwitterLinkedIn

Do you want more great blogs like this?

Subscribe for Dreamix Blog now!