Server name change in regards to databases

We are upgrading our servers and changing server names where our Notes databases reside: DEV - UAT - PROD

Is there a way to change the references to the server name in all of the database filenames, code, application profiles, etc…?

Subject: Server name change in regards to databases

And now you learned why you never hard code server names in your code. :slight_smile:

You can use TeamStudio Configurator to search through all your code (as well as all documents) and update the server names there.

Subject: Hard coding server:file = bad…really bad…

Now might be a good time to work through your code and change how you reference server and file names.

If the server reference you need will ALWAYS be the same server that the code runs on, you can do something like:

ServerName := @Name([CN]; @Subset(@DbName; 1));

In this way, as you move the app around, the server name changes with its location.

If the server reference can change (ie, app runs on server1 but you need data off server2), then use profile docs so you can set the reference for each case.

TeamStudio - another vote for Configurator. It will save your butt this time and make it easy to do a cross app search/replace if you decide to fix your code. It’ll pay for itself the first time you use it.

Disclaimer: I am not affiliated with TeamStudio but have used Configurator for years and just love it. Run and buy it now…right now!

Subject: RE: Hard coding server:file = bad…really bad…

Thanks for all the responses. Doug, I will take your advice on the code change!

We do have Team Studio Configurator but as far as I was aware that would only be by database and with hundreds of databases that would be in a sense manual. I did find that there is a batch process that I could use for multiple databases with Configurator. They also can write a custom search utility for a price.

Thanks again, this forum is very helpful!

Subject: RE: Hard coding server:file = bad…really bad…

But I would imagine that many of those database are based on just a few templates, you just update the template and the perform a design refresh.

Subject: Check out ‘Upgrade filters’

TeamStudio has another product called ‘upgrade filters’. It’s intended to help you know where your existing code will run into problems during an upgrade. You can build your own filters and have it search for code strings across multiple apps all at the same time.

I’d give them a call and see if they have anything else that would work for you; they’re good people and always there to assist.

Subject: Lotusscript

Hello!

Each design element in a database is considered as a NotesDocument. You can look up NotesNoteCollection in the Designer help to learn more.

The Catalog on each server lists each application. You could build a script to look thru the catalog, then an FTSearch for each document, profile document or design element and give a report of what needs to be changed. If you know what the new server names will be, then your script can replace the values in the NotesDocuments and save them.

If Configurator can work for you, then go for it. If not, then this script could help you.

Good luck!

Steve in NYC

Subject: RE: Hard coding server:file = bad…really bad…

And the Lotusscript way to do the same thing:

Set thisdb = session.CurrentDatabase

server = thisdb.Server

Set sourcedb = New NotesDatabase(server,“database.nsf”)

Subject: Server name change in regards to databases

Look at db and agent classes and you should be able to change the old server to the new server. You can search all the documents and profile docs for the server name but would be a lot easier if you knew what fields to search vs reading a docs and looping thru all the fields on the doc for the old server name. As far as the actual script libraries and formula language that will be trickier. For that you might want to look at Team Studio to see if they have a product.