Posts Tagged ‘CSDT Command Line Tools’


We have seen in the previous post about how to Export using CSDT Command Line Tool in Oracle WebCenter Sites / Fatwire.

Today we will see how we can Import using CSDT Command Line Tool in Oracle WebCenter Sites / Fatwire utilizing the exported data which is created earlier.

Before seeing how to use the Import using csdt command line tools, we should know what is meant by import first.

Import:

As the name itself is suggesting, it is the process of creating / importing the assets in(to) the content server. Here, assets means any thing inside the Content Server, right from start menus to templates. Everything. So we can import everything using this process.

Ok..How to use it?

Lets come to the point of how to do the import process using CSDT command line tools.

The syntax of csdt command line is as follows, which is common for both export and import.

java com.fatwire.csdt.client.main.CSDT [ContentServer url]  username= username password= password cmd=export|import|listcs|listds [options]

What are the parameters?

1. SERVER_INFO=http://:ContentServer         —- This is the server into which the assets need to be imported.

2. USER_NAME=fwadmin (or any other user name)

3. PASSWORD=xceladmin (or any other user’s password)

4. CLASSPATH= Path to the  csdt-client-11.1.1.8.0.jar and lib folders present inside the csdt-client folder. For example:

If you have placed your csdt-client folder inside the Content server installation directory, then the class path should be:

/csdt-client/csdt-client-11.1.1.8.0.jar:/csdt-client/lib/*
5. IMPORT_FOLDER_LOCATION=<Content server installation directory>/export/envision/cs_workspace/

This is the location where CSDT files needs to be moved before importing
6. DATA_STORE=/src

Say for example if your folder is CSDT_Backup_Files, then the path should be    /CSDT_Backup_Files/src.

Finally to execute the Import process , make sure that your target content server is running, and run the below command.

In the export process earlier, we have given the 13 digit content server id of the CSElement. But now to import, we need to give the UID created by the content server.

java -classpath $CLASSPATH com.fatwire.csdt.client.main.CSDT $SERVER_INFO username=$USER_NAME password=$PASSWORD resources=CSElement:ca572d73-ade3-4535-bc32-e2311b43fbb8 cmd=import

The above command exports the CSElement  which has the id 1326492057112, to the directory said above called CSDT_Backup_files.

How do I import other resources?

Below are the different resources which can be specified in the import script.

– @SITE – Specify the desired sites
– @ROLE – Specify the desired roles
– @ASSET_TYPE – Specify the desired asset types
– @TREETAB – Specify the desired tree tabs
– @STARTMENU – Specify the desired start menu items
– @ELEMENTCATALOG – Specify the desired ElementCatalog entries
– @SITECATALOG – Specify the desired site catalog entries
– @ALL_NONASSETS – Use this short-hand notation to select all non-asset resources
– @ALL_ASSETS – Use this short-hand notation to select all available assets
– asset type – Specify assets of a certain type.

That’s it.. your content is imported to the target machine.

Advertisements

We have seen the introduction of the CSDT Command Line Tools provided by Oracle WebCenter Sites / Fatwire in my last article here.

 EXPORT USING CSDT COMMAND LINE TOOLS:

Before seeing how to use the csdt command line tools, we should know what is meant by export first.

Export: As the name itself is suggesting, it is the process of getting the assets from the content server. Here, assets means any thing inside the Content Server, right from start menus to templates. Everything. So we can export everything using this process.

What is the use of this export?

As said above, what is your main motto? To Export and to import the assets from one server instance to another server instance. So, to move the assets from one instance to the other we need the exported data (assets). That is what we are going to do here.

Ok..How to use it?

Lets come to the point of how to use the export process using CSDT command line tools.

The syntax of csdt command line is as follows.

java com.fatwire.csdt.client.main.CSDT [ContentServer url]  username= username password= password cmd=export|import|listcs|listds [options]

This is generic, and the syntax is same for both export and import, except you need to change a few parameters.

So, what are the parameters?

1. SERVER_INFO=http://:ContentServer    –   This is the server from where the assets need to be exported.

2. USER_NAME=fwadmin (or any other user name)

3. PASSWORD=xceladmin (or any other user’s password)

4. CLASSPATH= Path to the  csdt-client-11.1.1.8.0.jar and lib folders present inside the csdt-client folder. For example:

If you have placed your csdt-client folder inside the Content server installation directory, then the class path should be:

/csdt-client/csdt-client-11.1.1.8.0.jar:/csdt-client/lib/*

5.  CSDT_EXPORT_FOLDER=CSDT_Backup_files

This backup folder will be created under /export/envision/

Finally to execute the export process , make sure that your content server is running, and run the below command.

java -classpath $CLASSPATH com.fatwire.csdt.client.main.CSDT $SERVER_INFO username=$USER_NAME password=$PASSWORD resources=CSElement:1326492057112 cmd=export datastore=$CSDT_EXPORT_FOLDER

The above command exports the CSElement  which has the id 1326492057112, to the directory said above called CSDT_Backup_files.

How do I export other resources?

Below are the different resources which can be specified in the export script.

– @SITE – Specify the desired sites
– @ROLE – Specify the desired roles
– @ASSET_TYPE – Specify the desired asset types
– @TREETAB – Specify the desired tree tabs
– @STARTMENU – Specify the desired start menu items
– @ELEMENTCATALOG – Specify the desired ElementCatalog entries
– @SITECATALOG – Specify the desired site catalog entries
– @ALL_NONASSETS – Use this short-hand notation to select all non-asset resources
– @ALL_ASSETS – Use this short-hand notation to select all available assets
– asset type – Specify assets of a certain type.

In the next post, we will see how to Import the assets using CSDT command line tools.