This article explains how to change the TCP/IP port that DataGate uses.

See this article for a list of other articles that may be helpful for this task

Why would you ever want to change the TCP/IP port? In normal circumstances, you’d generally not ever need to do this. However, consider the scenario of updating from DatGate 15.x to DataGate 16.x.

To test DataGate 16.x before you use it in production, install it alongside the existing DataGate 15.x instance, being sure to assign the DataGate 16.x a different TCP/IP port number than what DataGate 15.x is using. Use a special-case ASNA Database Name (created with the DataGate Studio in Visual Studio or the ASNA DataGate Monitor) to confirm that DataGate 16.x is working well for you.

When you’re sure you’re ready to commit to DataGate 16.x, you can delete DataGate 15.x from the IBM i. Then, change the TCP/IP port that DataGate 16.x uses to what DatGate 15.x was using.

To change the TCP/IP port that DataGate uses:

  1. Ensure no user jobs are active for either version of DataGate.

  2. End both instances of DataGate.

           and

  1. Delete the Service Table Entry for your old version of DataGate:

    • Type WRKSRVTBLE on the IBM i command line and press Enter.
    • Scroll to bottom of the list
    • The DataGate entry is usually listed as DataGatexxy where xx = main version number and y = minor version number
    • Use option 5 to display it
    • Write down its Service and Port values (just in case you need to recreate it–to be sure, take a screen shot of it. You’ll use the port value in Step 5.
    • Press enter to return to the Service Table Entries list and use Option 4 to remove this Service Table Entry. 
       
  2. Delete the Service Table Entry for your new version of DataGate:

    • Type WRKSRVTBLE on the IBM i command line and press Enter.
    • Scroll to bottom of the list
    • The DataGate service is usually listed as DataGatexxy where xx = main version number and y = minor version number
    • Use option 5 to display it
    • Write down the Service value — being careful to preserve its exact case (to be sure, take a screen shot of this display)
    • Press enter to return to the Service Table Entries list and use Option 4 to remove this Service Table Entry.
       
  3. Create a new Service Table Entry for your new DataGate instance:

    • Use the ADDSRVTBLE command to add a new Service Table Entry, where:

      Service = Use the Service value as determined in Step 4 (use exactly the same case as determined in Step 4).
      Port = Port value used by old instance (as determined in Step 3)
      Protocol = "tcp" where lowercase is very important!
      Description = DataGate xxy (where xx = the major DG version number and y = the minor version number)

  4. Restart your new DataGate instance:

  1. If you have Database Names using the old port number, be sure to refresh those database names with the new port number.

Other helpful DataGate for IBM i articles.