Import your projects and server settings

With the new Klocwork Server installed and the portal up and running, you can import server settings and projects from your existing Klocwork installation.

When you import server settings from the existing source server, all global permission settings are imported along with the permission settings for only those projects that exist on the destination server. In other words, if you import Server A's settings to Server B, then you import a project from Server A to Server B, any permission settings that are specific to project A will not be carried over to Server B. To carry forward project A's project-specific permission settings, you must re-import the server settings after performing the import operation.

When importing server settings from a source Server A to target Server B, the following also applies:
  • Authentication settings from source Server A overwrite the authentication settings on target Server B.
  • For roles that exist on both servers, the role permissions for source Server A overwrite the role permissions on target Server B.
  • Roles and their associated permissions that only existed on the source Server A are copied to the target Server B.
  • Roles that only exist on target Server B are not modified; their permissions stay the same.
Important: In cases where a project contains custom settings, you must re-import your server settings after performing a project import.

Note also that when importing a projects_root that contains a large number of issues and builds, your new projects_root may increase in size.

Importing your existing projects

  1. In the Klocwork portal, click Klocwork Static Code Analysis and log in to the product as the Projects root admin user.
  2. Click the Projects tab.

    If this is your first time using the installation, click the Import settings or projects button.

    If you've already created a project or imported a project, click the Import button.

  3. In the Klocwork server connection dialog, specify the log in and connection information for your existing Klocwork installation (the installation from which you want to import). Specify:
    • the URL of the existing server, for example: http://server21:8082
    • your user name. Note: you must have Projects root admin rights in order connect to the server and import your projects.
    • your password (if required)
  4. Click Import server configuration to import the existing server's configuration settings. This includes authentication configuration settings, permissions, custom metrics, reports definitions, and e-mail subscription settings.
  5. Note: If your default project settings have been set on the existing portal (by using 'kwadmin import-config'), then the files in projects_root/projects/workspace/rules must be manually imported using kwadmin import-config into the new portal.

    Note: If you import authentication settings, the system may log you out as your credentials may no longer be valid. If this happens, log in using the Admin credentials you just imported.

  6. Click List Projects to see a list of projects in your existing projects_root.
  7. In the Choose projects to import dialog, select the project(s) that you want to import to your new projects_root.
  8. Click Import. The Import status dialog will display the status of the project import, while an import status message will appear at the top of the Projects tab.
    Any project that imported successfully will appear in your projects list.
    Note: During the import process, while projects are actively being imported, issue information in the Projects view may not accurately reflect the data in the source project. Information in the Projects view will be updated as soon as the import operation has completed. Check the import status indicator for progress information.
  9. Click Import server configuration again to import any project-specific configuration settings. This is a mandatory step, since any project-specific configuration settings will be lost if you do not re-import the server settings.
  10. For each imported project, click Permissions and check that the permissions are correct for each project.

It is important to verify the permissions for each project since at import time. You should repeat this process after each import operation, and you must be careful to re-import the server settings for each source server that you import from.

Use the Web API to import your projects

You can use the Klocwork Web API to import your projects on the command line. The Web API requires Web API access permissions. By default, the Project admin role and the Projects root admin roles have access to the Web API. The following example shows a curl script to import a given project:

curl --data "action=import_project&user=myself&project=my_project&sourceURL=
http://oldserver:8080&sourceAdmin=user&sourcePassword=pwd" http://localhost.mycompany.com:8080/review/api

where:

  • project is the name of the project you want to import.
  • sourceURL is the URL of the existing, source Klocwork Server.
  • sourceAdmin is the user id of the source Klocwork Server administrator (must have Projects root admin access).
  • sourcePassword is the administrator's password.

To return a list of all projects in the source projects_root folder, run the following command:

curl --data "action=projects&user=myself&" http://localhost.mycompany.com:8080/review/api

You can also use the Web API to import your server configuration settings:

curl --data "action=import_server_configuration&user=myself&sourceURL=
http://oldserver:8080&sourceAdmin=user&sourcePassword=pwd" http://localhost.mycompany.com:8080/review/api

Typically these operations are scripted using a language such as Python. See the Klocwork Web API cookbook for examples of scripted curl calls using Python.

Import taxonomy file(s)

If you imported a custom taxonomy in a previous release, you need to re-import the new taxonomy file to pick up changes. See What's new for a list of changes to the taxonomies.