Import your existing projects into a new projects rootImport your existing projects into a new projects rootKlocwork includes a simple GUI that you can use to import projects from an existing projects_root to your new Klocwork installation. This allows you to migrate your data on a project-by-project basis without using the command line. Before you decide to import your projects, make sure that your current installation supports this feature. Typically, this process involves the following steps:
Before you beginThe import process involves running your existing Klocwork installation (and projects_root) and your new Klocwork installation (with clean projects_root) concurrently. Once you've installed the new server, you must import any projects from the existing projects_root into the clean projects_root. Remember that you cannot run two Klocwork servers on the same machine without specifying unique port numbers. If you plan on installing the new Klocwork installation on the same machine, it's a good idea to stop and restart your existing server using a different port number. This will allow you to maintain the existing port number for your new installation. If you are moving to a new major release of the software, ensure that you have a compatible license, as each major release requires a new Klocwork license. See Licensing for more information. Also, FlexNet Publisher prevents more than one instance of the vendor daemon from running on each machine, which means that you cannot run two License Servers on one host. In this scenario, you need to run one License Server and point both Klocwork installations to that License Server. See Licensing with multiple projects_root directories for more information. Both the Klocwork and Database servers require fully qualified domain names or IP addresses assigned in order to be accessible from the target server host during the import process. Don't use localhost. Note: You must have Projects root admin access in order to perform the import operation.
Supported upgrade paths to versions of Klocwork that support project importFind your current version in the chart below and follow the appropriate upgrade path. Once you've upgraded to the correct version of Klocwork, you can import your existing projects from there. The chart below is accurate for the latest current release.
Interoperability between releasesTo take advantage of the latest improvements in Klocwork, we always recommend you upgrade your Server, Build, and Desktop Analysis plug-ins to the latest version of the product. Klocwork Server, Build and Desktop Analysis plug-ins are compatible within each major release, so you can use 2018 plug-ins with a version 2018.1 Klocwork Server. You can also use older build server tools with newer versions of the Klocwork Server, up to three minor releases back. For more information, see Cross-version support for builds. If your current Klocwork server version does not meet the version requirements for importing projects, upgrade your existing version of Klocwork to a supported service release or version. Next, install the latest version of Klocwork. After you've installed the latest version of Klocwork, you can use it to connect to your existing Klocwork server and import your projects. Follow the steps described below to import your projects. Install the Klocwork Server packageInstall the Klocwork 2018.1 Server package. For instructions, see Installing Klocwork. Be sure to copy your license file to <projects_root>/licenses. Note: See Licensing for information about options.
Start the serverOnce you've installed the new version of Klocwork, start the servers. Each installation of Klocwork requires you to specify a unique hostname and port number combination. You can specify the unique hostname and port number combination either at startup, or during the installation process. See, Managing the Klocwork Servers for more information. Validate your database (mandatory)dbvalidate is a tool that checks the consistency of data in your database. Running this tool is mandatory, so that any errors in your database can be corrected before you migrate or import. Use the version of the dbvalidate tool that matches your installed version of software. Note: The Database Server from your old installation must be running to validate the database. The Database Server is listed as a separate service from the Klocwork Server, so ensure that it is running.
Run the following command, for example:
java -jar <2018.1_server_install>/class/dbvalidate.jar --projects-root <projects_root>
where
Example java -jar /local/tools/klocwork/server/class/dbvalidate.jar --projects-root /local/tools/klocwork/server/projects_root The dbvalidate tool will report any errors between the "validation started" and "validation finished" lines: Wed Jun 01 07:53:58 CDT 2018 kw_central database (version: 95) validation started <detected errors appear here> Wed Jun 01 07:54:28 CDT 2018 Database validation finished.
Log in to Klocwork Static Code AnalysisAfter starting the Klocwork servers, Klocwork Static Code Analysis is accessible from a browser using the URL of the Klocwork server hostname and the Klocwork server port chosen during the install (for example, server21:8080). By default, the person who installed Klocwork is set as the Klocwork administrator, and is given the Projects root admin role. Initially, the Basic Authentication access control method is used, so no password is needed to log in. For example, if the user account used during the installation was ‘jsmith’, to log in to Static Code Analysis with the administrator role, use the credentials:
username: jsmith password: <empty>For more details on security and authentication methods, see Security and permissions. Import your projects and server settingsWith 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. 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. To import your existing projects:
It is important to verify the permissions for each project since at import time, permissions are merged between source server and destination server. 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. Note: If you are running Windows in a 32-bit environment and you previously modified the memory allocation file located at <old_Klocwork_install>/config/java_wrappers_memory.conf, verify that you still need those modifications and make the same changes to java_wrappers_memory.conf in the new installation.
Use the Web API to import your projectsYou 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:
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, for example, MISRA, 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. If you're using MISRA checkers, you'll also need to copy the misra.checkers.zip file from the <server_install>/taxonomies folder into the <projects_root>/plugins folder. Import your code reviewsYou can import your existing code reviews into your new projects root.
To import your existing Klocwork Inspect code reviews:Note: Before importing code review data, you must have the equivalent project in your local projects root. Importing code review data will overwrite any existing code review data in the current projects_root folder.
To import your existing Klocwork Code Review or Cahoots code reviews:Note: Klocwork Code Review does not organize code reviews by project. When you import existing code reviews from your Code Review server, you must specify the code reviews by tag.
Test your upgradeEnsure that you can see your projects and builds in Klocwork Static Code Analysis. If you installed a new license file, ensure that it was installed correctly by checking that the number of licenses is correct. Go live with your new installationOnce you're satisfied that your new installation is valid, and that your existing projects were imported correctly, it's time to go live with your new installation. If you've chosen a new and unique port number for your new installation, then you can go ahead and communicate that information to your users. If you'd like to reuse your existing port number (so that users don't have to update their local settings) then you'll need to stop and restart all of your Klocwork servers, taking care to specify the existing server port number for your new installation. Upgrade all Desktop Analysis plug-insEnsure that all Klocwork plug-ins are upgraded to Klocwork 2018.1. Your users can reinstall their Klocwork Desktop Analysis plug-ins themselves by downloading the appropriate plug-ins from the Klocwork portal once it is up and running. See Downloading and deploying the desktop analysis plug-ins for instructions on how to download and deploy the plug-ins to the server.
Note: When upgrading to the Klocwork extension for Visual Studio, any analysis results data generated from the previous version of the plug-in will be removed. Therefore, any local defect citation information not already synchronized with the server will be lost. You can re-analyze your solution(s) to get the analysis results with the new plug-in.
Before your first integration build analysis using Klocwork 2018.1New releases of Klocwork normally have changes to the checker configuration to keep up with current events and respond to customer requests. These changes may mean that your checker configuration from the previous release isn't the same in the new release. Make sure that you have the right checkers enabled to match your old configuration. See What's New for a list of updated checkers, then make any changes to your checker configuration. After you're satisfied with your configuration, perform your first Klocwork 2018.1 integration build analysis on unmodified source code. Note: If you've already run your first Klocwork
2018.1 analysis and you're missing some issues or status changes, delete that build, reconfigure your checkers, and run a new analysis.
We recommend running your final pre-upgrade integration build analysis and your first Klocwork 2018.1 analysis on identical source code, and then comparing the two builds. This allows you to assess changes in the analysis engine. For details on improved, added, and removed checkers in this version, see What's New. |