UpdateServerUrl

Use UpdateServerUrl to update the IBM® Cognos® server information for existing reports and formulas.

Syntax

The UpdateServerUrl method takes two arguments: the old server URL and the new server URL. These arguments mirror the entry boxes in the Update System dialog box. To gain access to this control from IBM Cognos, click the Options button on the IBM Cognos ribbon, then click Update System Utility.

The UpdateServerUrl method replaces the server information for existing reports. When running this command, the name of the package or data source remains the same. You can use this method to change only one server, such as a test server to a production server. The URL arguments can be full or partial URLs. If any argument is empty, this command does nothing, however, running this command with empty arguments has the potential to corrupt the report. Server information is stored in both the server property and the serialized report property. Running an empty command could cause these two instances to get out of sync.

Because the UpdateServerUrl method searches and replaces strings, it is possible to use only part of the URL, provided it is a unique substring.
Note: The UpdateServerUrl search looks at all data in the workbook and updates data that matches the search string, not just report properties containing the URL string. Therefore, when you use only part or all of the original URL string with the UpdateServerUrl method, you will change all data that matches the search string

UpdateServerUrl "old server URL string" "new server URL string"

Parameters

Table 1. Parameters for the UpdateServerUrl method

Argument

Description

Data type

old server URL string

Indicates the URL of the source or current system.

String

new server URL string

Indicates the URL of the target system.

String

Example

The following example uses the complete URL:

UpdateServerUrl "http://testserver1/bi/v1/disp" 
"http://prodserver1/bi/v1/disp"

The following example uses only the part of the URL that is changing:

UpdateServerUrl "testserver1" "prodserver1"