*If you will have the same users in the new project that are in the existing project.
The Solution
To avoid the Personal and/or User definition files being part of this import, we would suggest the following:
Log in to the existing project as MANAGER
Select Project > Export
In the Export dialog set Owner to Everything and Info Type to ProjectSchema and User Profiles (if users are required, see comment above)
Press Export to create the export file and close the Export Status dialog but do NOT close the Export Information dialog:
In the Export Information dialog, change the Info Type to ONLY show Definition Files:
You will see that some new options appear – Definition Type and Location:
The Definition Type option allows you to specify the types of definition file to be included in the export. For this example, we will leave this as All:
The Location option defines which location you are exporting the definition files from. Users may have created Personal or User definition files that might not be relevant to the new project. Personal and/or User definitions might only have been useful to an individual person rather than the project so could be omitted. In this case, we would only need to select Team*, User Type* and Project
* It may only be necessary to select Project
Press the Export button again. This will present you with the option to Overwrite, Append or Cancel. Select Append:
In Project Manager, create your new project with an EMPTY schema:
Log into the new project as MANAGER
Select Project > Import and set Owner to As in File and Overwrite to On:
You will see that your new project contains:
Users
All the Project Setup information including the phase hierarchy and all supporting definition files
Summary Note
If you had NOT chosen to append the definition files, it is highly likely that the phase hierarchy from the existing project would not work in the new project and would produce errors.
These definition files are important to define the WorkBench environment.
Also, if you had chosen to export all the definition files, this may have resulted in numerous views, forms, queries, documents etc., that are not particularly relevant or accepted into project definitions.
Can I keep an item’s change history when exporting?
The simple answer is yes!
I certain scenario’s you may need to export items from one Cradle database and import them into another. Depending on your reasons for this, you may want to retain an items change history. However, this is only possible when using the Standard Cradle Export Format and Change History is enabled for your item types.
Enabling Change History
Each item type can have change history enabled in the Project Schema via the Project Setup dialog. You can see how to enable change history in this Cradle help article. Once enabled you should start to receive a change dialog pop-up when making changes to items of that type.
Change details
You can choose to enter a change comment, which can include your reasons for making this change. This can prove useful in situations where there are a large number of users in one database enabling full traceability.
Standard Cradle format
Cradle export format files are unique to Cradle and can store every piece of PDB (Project Database) information which does include an item’s change history. However, the type of information that is stored can be further defined by you in the export interface.
Cross references, or links, are used to connect items in the database. Each cross reference connects two items. A cross reference represents the fact that the two items are related in some way. Sometimes, it is helpful to load cross reference links en masse from an external file.
Types of File to Load
Cradle can load data from files in three main formats:
Cradle
CSV / TSV, comma separated value or tab separated value
XML, there are many possible dialects of XML
Microsoft Excel® can easily produce CSV files. Also, it is easy to work with collections of simple data in Excel. Therefore, we recommend that you use Excel to load cross reference links into Cradle using CSV files.
Example
In this blog entry, we will assume that you want to load cross reference links between user-defined items, such as system requirements and verifications, or test cases to test results. So, if you want to do anything else, please look in the reference section below for links to the Cradle help.
In our example, we will create links of type FRED from PROCR items to SR items.
Create Cross Reference Links
You will need the following columns in your Excel spreadsheet:
Type, use the value: NOTE_NOTE
Link Type, the link type of the cross references that you want to create. In our example, this is the link type: FRED.
From Info Subtype, use the value: NULL_INFOSUB
For From Model Namespace, use the value: MH_IGNOREMODEL
From Number, this contains the Identity of the item at the from end of the cross reference. In our example, this is the Identity of the PROCR item.
From Type, this contains the type of item at the from end of the cross reference. In our example, this is: PROCR.
To Info Subtype, use the value: NULL_INFOSUB
For To Model Namespace, use the value: MH_IGNOREMODEL
To Number, this contains the Identity of the item at the to end of the cross reference. In our example, this is the Identity of the SR item.
To Type, this contains the type of item at the to end of the cross reference. In our example, this is: SR.
These fields can be in any order.
Define Cross References in Excel
Load Cross Reference Links
You can load the CSV file containing your links by:
Select Import from the Project tab in WorkBench
Set: File Type to be: CSV
Then, set: Info Type to be: Cross References
Also, set: Overwrite to be: Off, as this is safer than the other options(!)
And set From file to be where your CSV file is stored
Click Import
Load Cross Reference Links
You will be asked to define the mapping between fields in the CSV file and the attributes of cross references. Because the column headings in Excel match the names of the attributes, everything is mapped automatically:
Load Cross Reference Links – Field Mapping
Click OK to load cross reference links from the CSV file.
Link Rules
The link rules defined in your schema are used to control if cross references will be imported from your CSV file. You can set an option to ignore your link rules, if you want to.
Dangling Links
Importing cross references this way may create dangling cross references. A cross reference is dangling if the item at its from end, or its to end, does not exist. Cradle allows you to import these cross references because it would be too restrictive to prevent you doing this.
You can detect and remove dangling cross references using the Cross Reference Integrity check in the Project tab in WorkBench.
Reference in Cradle Help
You can review the details of Cradle’s CSV file format in the Cradle help. Every Cradle system contains the Cradle help. You can access this help from the Help tab in every Cradle UI, and (on Windows) from the Cradle Help item in the Start menu.
We also provide the Cradle help on-line in our website:
Exporting either a whole project or just a query can take a long time if the database is huge. The quickest and easiest way to do this is use c_io.exe in a batch file during down time e.g. night
The options available are:
Export Options for c_io.exe
Required Export Options
So the first option is, of course, the export option that needs the user to specify a location and a name for the exporting file:
-export “C:\Temp\export1.exp”
The Type Options
The -type option is required for the export option and allows users to define the type of export they require:
params will export only this projects parameters (Project Schema) all will export all items and definition files the user has access to pdb will export all items the user has access to but not definition files query export items matching a named query.
Options used with query
-query will specify the query to be used. This is required if the type is set to query -qloc will specify the location of the query. This is required if the -query option is used.
expformat is for exporting all files set in a saved format.
Options used with expformat
-expname is the Export Formats name. -exploc is used in conjunction with -expname to state the location of the export format -identity can be used with -expname and will override the Identity set in a query.
Export UI IdentityQuery UI Identity
basesum requires the user to use -basename with the Baseline Name and -sumformat which allows the user to specify how the data is output either as CSV or standard (Note: the user must have the PROJECT_RO privilege for this option)
Options used with basesum
-basename needs to have a Baseline name currently either open or closed. – sumformat allows the user to state they format -basesum is output as CSV or standard.
The standard output is <BASEHIST> records in the normal format:
The CSV output will set the fields from left to right and output the items below this line:
Elective Export Options
Other export options are not required but can be used with –type all and -type pdb: – since can be used to state a date or date and time since which items were created or modified. The format for this is yyyymmdd or yyyymmddThhmmss so 20170119 (19/01/2017). For example 20170119T183030 (19/01/2017 18:30:30)
-until will only export items that have been modified up to a certain date or date and time or a time after the -since was set. The format for this is the same as -since.
-delete_state allows the user to specify if they want the items being exported to be (Same as in the Export UI):
normal – Not marked as delete recoverable – Items marked as deleted but can be recovered all – All items not matter what they are marked as will be exportedThe Delete state in the Export UI in WorkBench.
-scope controls how an item is output either on its own or with all the items cross referencs. Using item will make sure only the item on its own is output. Using item_xref will output the item and any items cross referenced to it.
-binarytodir sets a folder for the binary data. So a user would use -binary “C:\Temp\binary” and all binary data would be output to unique files and the path to this file would be output in the export file next to the binary frame:
-sanitise will output items but without any binary frames. It will also change all text including item names, comments descriptions, text frames, change history, diagram symbols, discussions and user defined cross reference attributes.
A few of the options not used in a batch file but are in a command prompt. These are pop ups with information on them which why they are not in a batch file.
-verbose lets the user know that c_io.exe has finished -ver lets the user see what the version number, date and time of the build they are using. -help is used to see all the command line options.
C_io.exe can be useful when importing large files or when a user has a lot of files. When c_io is in a batch file, it can import different files into different projects within one batch file. This file is then run when no one is in the database and so there should not be any issues.
The options available are:
Import options for c_io.exe
Required Import Options
The first option for importing needs the user to specify a location and a name for the file: -import “C:\Temp\import1.exp”
All saved Import Formats in WorkBench can be used with -import
-impname is the Import Formats filename. When an Import Format is being used -overwrite, -owner, -ipid, -cpid and -noalerts are set from this file.
-imploc is the location of the Import Format file.
Elective Import Options
-overwrite is used when a user requires any items in the database to be overwritten, merged or not overwritten. If not in the command line the default of off is used.
off – no data will be overwritten and only new items added
-owner sets by whom the items imported are going to be owned by. Depending on the option set depends on the owner of the items:
user option is owned by the user in the login option e.g. -login ADMIN the items will be owned by the ADMIN user.
File option is the owner as stated in the import file
A user can be specified and all items imports will be owned by that user e.g. -owner REQMAN
WorkBench Import UI showing Owner Options
Additional Options
-ipid is the option to let c_io know whether to use the PIDs in the file or in the project it is being imported into.
Off means the PIDs will be generated.
On means the PIDs in the file will be used.
-cpid allows a user to specify the PID to be used for the items being brought in.
-noalerts option stops alerts from being generated during the import
-ignorelinkrules allows any cross references to ignore projects link rules in the current project but only if the user has the correct privileges. The user must have either ACCESS_BYPASS or PROJECT for this to work.
-noautoid allows the original numbering for items rather than any auto numbering set in the Project Schema.
-nocheckdata option stops data being checked so it is all imported.
-add_itemhist is the same a Auto update modification details and sets the current user, date and time, not what is specified in the file.
-itemhistcomment will include a Change History comment which will include the last modifier, modification date and time
-add_imphist will create a log with the history of the import. It shows the options used, who performed it and the date and time of the import.
-set_modify uses the current date and time instead of the date and time specified in the imported file.
There are a couple of options that are not used in a batch file. The reason is that they are only useful in a command line, in a command prompt as they show pop ups with information on them.
-ver lets the user see what the version number, date and time of the build they are using. -help option allows a user to see the command line options.
Cradle can import data from external files in different formats. One of the most common formats is CSV / TSV (comma separated value and tab separated value). When data is imported from CSV / TSV files, you can choose different import overwrite options. The option that you choose will control whether your data is imported and, if it is imported, which existing data in your database will be kept, or replaced by data from the import file.
Items and Attributes
To explain these options, let’s use a simple picture to represent an item and the attributes inside it:
An Item With Some Attributes
Example
Lets say in your Cradle database you have an item with the following attributes:
A Cradle Database Item with Some Attributes Set
meaning that the item in the database has values set in the 2nd, 4th, 5th and 6th attributes.
In a spreadsheet you have a row with data in columns corresponding to the 1st, 2nd and 5th attributes of the item in the database:
An Item in an Import File with Some Attributes Set
Import Overwrite Options
Option A – Overwrite On
If Overwrite is On then, for each row in the spreadsheet or each record in the CSV / TSV file, Cradle will find the work-in-progress item (if any) and delete everything inside it, and completely replace the contents of the work-in progress item with the data from that record or spreadsheet row.
You would get the following result:
Import Overwrite Options – On
As you can see, only the data from the file or spreadsheet (the yellow cells) are now in the item, all previous attributes (the blue cells) are now gone.
Option B – Overwrite Off
If Overwrite is Off then if there is an item in the database for the record in the CSV / TSV file, or row in the spreadsheet, no import will occur. If there is no item in the database for the record or row, then the result is the same as Overwrite set to On.
Option C – Overwrite Merge
This is the more interesting case!
If Overwrite is Merge then, for each row in the spreadsheet or record in the CSV / TSV file, Cradle will find the work-in-progress item (if any) and replace the attributes of that item with the columns from that row in the spreadsheet (or field i the CSV / TSV file) so any attributes in the item that have not been mapped to a column in the spreadsheet row (or field in the CSV / TSV file) will be left alone.
So the attributes that already exist in the item in the database and the attributes in the spreadsheet row or file record are merged:
Import Overwrite Options – Merge
You would get the following result:
Import Overwrite Options – Merge
Attributes in the spreadsheet row or file record have been loaded into the item. All other attributes in the item have not been changed.
Summary
Setting Overwrite to Merge is useful to add data to database items from an external CSV / TSV file or Excel spreadsheet. Any attributes not in the external file are not affected by the import.
To get more help importing information into Cradle, explore the Cradle help here.
We are sometimes asked if it is possible to export the contents of individual baselines. Most commonly for baselines that have been closed in the past. The short answer is yes, and here’s how:
Select the Review tab, then ‘Set Mode’ and choose the baseline to be exported
Select the Project tab, then ‘Export’ and specify the type(s) of information to export and set the owner to ‘Project’
Specify an output filename and any other options needed, and select ‘Export’
Note: You should NOT try to import information into old baselines. This is because:
You could easily create inconsistencies in baseline histories that could also prevent the Configuration Management System (CMS) from working correctly
It breaks the principles of good CM and your formal CM process