Prod Def Backup

A need arose where I once worked. Our deploy process was as such

1 – Log onto Dev server, and export a def file of the packing list to be moved to production
2 – Log onto Production server and export a def file of the objects that exist in the packing list that are going to be modified

This process is easy enough when you only have a few objects in your PL, but if your packing list is extensive, it can take quite some time to pair up the contents of the packing list on one server to the existing objects on the production server, and is error prone to be able to miss objects.

So, I wrote this little application. You can either provide it command line parameters, or you can use the supplied properties file (once configured). This program logs into your source server, grabs the contents of the packing list, and exports two copies. The first copy is from the source server (Dev), and the second copy is from your destination server (Prod), but only the objects in your packing list that exist on prod, and gives you a separate output file telling you the names of all of the objects that it exported from the destination server.

java -jar ProdDefBackup.jar -ss <server> -su <user> -ds <server> -du <user> -pl <packinglist> [-o outputprefix -sp <password> -st <tcpport> -dp <password> -dt <tcpport>]
Required
-ss: This is the source server to connect to
-su: User used to connect to the source server
-ds: This is the destination server to connect to
-du: User used to connect to the destination server
-pl: This is the packing list to export contents from destination server
Optional
-c: Config file to use for configuration, if unspecified it uses APLProdDefBackup.properties
-o: This is the output prefix that will be used. If left unspecified “APLProdDefBackup” will be used
-sp: Password of the user being used to connect to source server
-st: TCPPort to connect to source server, uses port mapper if undefined
-dp: Password of the user being used to connect to destination server
-dt: TCPPort to connect to destination server, uses port mapper if undefined

Version History

1.1 – November 12th 2015

  • BUG: I apparently never wrote into the code, the ability to read the source and destination ports from the config file, so if not specifying the ports on the command lineĀ it was assuming port 0 and trying to use port mapper, this has been corrected
  • CHANGE: I renamed the default config file from a ‘.ini’ to a ‘.properties’ file

1.0 – January 18th 2013

  • Initial release