Why remapping URLs in Registry Services?
Daniel Figueiredo Caetano 2700069HKJ Visits (1805)
An interesting tool that Registry Services provides is a command line interface (CLI) that can be used to change URLs in Service Providers and Registration Records. It is safe and very flexible to attend several use cases. An example: suppose that a Service Provider is running on AustinSP1 server, and this server crashes; the URLs for all the records that are created by this Service Provider in Registry Services still point to AustinSP1, which is no longer accessible.
The following sections will explain how to solve this and similar problems.
First of all, let's take a look at the general syntax.
By using the Registry Service CLI, the general syntax for the remapUrl command is:
./frs.sh|frs.bat remapUrl -registryType provider|resource [-filterRule query_string] -patternRule regular_expression -replacementValue URL_
You can get further information about the command, such as possible return codes and required arguments, in the Jazz for Service Management Info Center (htt
The goal of remapUrl command is to let server administrators dinamically replace contents from Service Providers and Registration Records, created by a particular Service Provider, based on regular expressions; these replacements are done on the database records that are returned after a query by using the search criteria specified in the “filterRule” argument.
Replacing a Service Provider address
There are a few options that can be used when remapping URLs in Registry Services. However, the most used arguments are certainly the -patternRule, -replacementValue and -filterRule. By combining the power of regular expressions used in -patternRule, with the possibility to filter records by using the default query mechanism, it is possible to handle several scenarios.
For example, the Registry Services server has a Service Provider record with the following URL:
Then, for any reason, the server is moved to:
By using the remapUrl command, we can easily change the Service Provider record and make URLs point to the new server:
./frs.sh remapUrl -registryType provider -patternRule server1 -replacementValue server2
Or we can tell it to find any attributes containing the serverN hostname and change them to server2, i.e:
./frs.sh remapUrl -registryType provider -patternRule server\d -replacementValue server2
Remapping Registration Records
This next example changes all Registration Records with ComputerSystem type owned by a Service Provider (12345), replacing “IBM”, case insensitive value, with “Lenovo”.
frs.bat -registryType resource -patternRule IBM -replacementValue Lenovo -filterRule “osl
Make sure that all URLs are valid after remapping, this is a powerful mechanism and can easily corrupt the database. Moreover, only database backups can revert the changes, so be careful when using the remapUrl CLI.