Midrange News for the IBM i Community


Migrating to a New Box Published by: Bob Cozzi on 19 Oct 2011 view comments
© 2011 Robert Cozzi, Jr. All rights reserved.

© Robert Cozzi, Jr. All rights reserved. Reproduction/Redistribution prohibited.
A midrangeNews.com Publication

PTF Procedures Are Great If it were 1999

Loading PTFs onto the System i - The way it is today

When I need to update a Windows PC, I run Windows Update or if I have it set correctly, it will run in the background for me; and it will download and then allow me to apply updates.

When I need to update an Apple Mac PC, I run Software Update and it will download and then allow me to apply updates.

When I need to update a System i running IBM i, I, um.... call my friend Bruce Hoffman and ask him what to do. As it turns out, I have to:

  1. Sign onto IBM Fix Central
  2. Find the PTFs I need/want (meaning I have to know what they fix and what I already have or don't have
  3. Select them for download
  4. Request where the download link is sent via email (I can also have it start right away)
  5. Sign onto the FTP server
  6. Navigate to the folder identified in the email IBM sends me
  7. Create a folder on the IFS to receive the PTF images
  8. Use FTP MGET (or GET if only one file) to download the PTF images
  9. Create an image catalog
  10. Add the IFS folder to that image catalog
  11. Mount the catalog as an Virtual Optical Drive
  12. Very on the VRT OPT drive
  13. Use GO PTF and take option 8
  14. Specify the catalog's virtual optical drive
  15. Press Enter

Now, something tells me that a machine that costs from $200 to $5000 (PC or Mac) does something infinitely better than a $25,000 to $1 million IBM i system. That's a shame.

PTF's - How it Should Be

  1. RTVPTF
  2. View the list of retrieved PTFs and whether or not they are installed on the system along with their urgency
  3. Allow me to give a Yes/No on them or an "Install All" option
  4. Press Enter
  5. Automatically download the PTFs "under the covers"
  6. Automatically install/apply the PTFs
  7. Wait for the system to re-IPL
  8. Done

Basically I'm suggesting the PTF process actually be simple, not just simple to the Engineers who are implementing this stuff. And while we're at it, since Operating Systems have become a commodity, there is no reason a POWER System with IBM i OS upgrade should be any more complex that "do it, and wait for it to come back up".

Migrating to a New Box

More and more today, shops that are migrating to a new system (model upgrade) are bringing in a skilled upgrade specialist; someone like Pete Massiello of iTech Solutions, or Bruce Hoffman.

What I thought would be helpful, however, is to create a list of what the do-it-yourself shop would need to do to get an old machine to a new one. This is more a less a shell for a custom CL program, your mileage may vary.

If you have any additions, corrections or things to remove, please leave/post a Comment below this article, and now get that new box installed!

Sponsored by: BCD Software
Ad

MOVESYS Command Definition Source

 MOVESYS:    CMD        PROMPT('Migrate Sys to new Server')
             PARM       KWD(TOSRV) TYPE(*PNAME) LEN(64) DFT(NEWSYS) +
                        SPCVAL((NEWSYS)) EXPR(*YES) +
                        PROMPT('Target server') 

MOVESYS CL Source

 MOVESYS:    PGM        PARM(&TargetServ)
             DCL        VAR(&TargetServ) TYPE(*CHAR) LEN(64)
             DCL        VAR(&TOSERVER) TYPE(*CHAR) LEN(20)

                 /*  Default name or IP for target system to receive migration   */
             DCL        VAR(&DFTSRV) TYPE(*CHAR) LEN(20) VALUE('NEWSYS')

                 /*  Work library to store migration objects/savefiles   */
             DCL        VAR(&MIGLIB) TYPE(*CHAR) LEN(10) +
                          VALUE('SYSMIGRATE')
                 /*  Work library to store System Configuration objects  */
             DCL        VAR(&SYSCONFIG) TYPE(*CHAR) LEN(10) +
                          VALUE('SYSCONFG')

             DCL        VAR(&OMIT) TYPE(*CHAR) LEN(10)
             DCL        VAR(&LEN) TYPE(*DEC) LEN(15 5) VALUE(2000)
             DCL        VAR(&USER) TYPE(*CHAR) LEN(10) VALUE('QDFTOWN')
             DCL        VAR(&PWD) TYPE(*CHAR) LEN(10) VALUE('QDFTOWN')

             DCL        VAR(&JOBUSER) TYPE(*CHAR) LEN(10)
             DCL        VAR(&JOBNAME) TYPE(*CHAR) LEN(10)
             DCL        VAR(&JOBNBR) TYPE(*CHAR) LEN(6)

             DCLF       FILE(QADSPOBJ)
             MONMSG     MSGID(CPF0000)

             CHGJOB     LOG(3 00 *MSG) LOGCLPGM(*YES)
             RTVJOBA    JOB(&JOBNAME) USER(&JOBUSER) NBR(&JOBNBR)
             SNDPGMMSG  MSG('Started Migration. WRKJOB' *BCAT +
                          &JOBNBR *TCAT '/' *TCAT &JOBUSER *TCAT +
                          '/' *TCAT &JOBNAME) TOMSGQ(*SYSOPR)

             CHGVAR     VAR(&TOSERVER) VALUE(&TargetServ)
             MONMSG     MSGID(MCH0000) EXEC(DO)
                CHGVAR     VAR(&TOSERVER) VALUE(&DFTSRV)
             ENDDO

                   /* Add any necessary libraries to make this CL work  */
             ADDLIBLE   LIB(rpgReport) /* RPGREPORT contains the FTPFILE command */

             CRTLIB     LIB(&MIGLIB) TYPE(*TEST) TEXT('Mirgration to +
                          520 Staging library')
             CHGCURLIB  CURLIB(&MIGLIB)
             CRTLIB     LIB(&SYSCONFIG) TYPE(*TEST) TEXT('Mirgration +
                          Library for System Info')
             MONMSG     MSGID(CPF0000)
             RTVSYSINF  LIB(&SYSCONFIG) /* Save Sys Info so it gets FTP'd  */

             CRTSRCPF   FILE(&MIGLIB/QFTPLOG) RCDLEN(240) TEXT('FTP +
                          runtime log output text files (members)')

                         /* List all the user libraries to be migrated */
             DSPOBJD    OBJ(QSYS/*ALL) OBJTYPE(*LIB) +
                          OUTPUT(*OUTFILE) OUTFILE(&MIGLIB/&MIGLIB)
             OVRDBF     FILE(QADSPOBJ) TOFILE(&MIGLIB/&MIGLIB)
 READNEXT:   RCVF       RCDFMT(QLIDOBJD)
             MONMSG     MSGID(CPF0864) EXEC(GOTO EOF)
                 /* Read each user library name, skipping those we  */
                 /* want to filter out.                             */
             IF  ((&ODOBNM *NE ' ') *AND +
                  (&ODOBNM *NE &MIGLIB) *AND +
                  (&ODOBNM *NE &OMIT)   *AND +
                  (%SST(&ODOBNM 01 03) *NE 'MOV') *AND +
                  (%SST(&ODOBNM 01 03) *NE 'SAV') *AND +
                  (%SST(&ODOBNM 01 01) *NE 'Q') *AND +
                  (%SST(&ODOBNM 01 01) *NE '#')) THEN(DO)

                SNDPGMMSG  MSGID(CPF9897) MSGF(QCPFMSG) MSGDTA('Saving +
                             library' *BCAT &ODOBNM *BCAT 'to save +
                             file' *BCAT &ODOBNM *BCAT 'in' *BCAT +
                             &MIGLIB) TOPGMQ(*EXT) MSGTYPE(*STATUS)

                 /* Backup/Save the library to the corresponding savefile  */
                CRTSAVF    FILE(&MIGLIB/&ODOBNM) TEXT('Save file for' +
                               *BCAT &ODOBNM)
                SAVLIB     LIB(&ODOBNM) DEV(*SAVF) +
                               SAVF(&MIGLIB/&ODOBNM) CLEAR(*ALL) +
                               DTACPR(*YES)
             SNDPGMMSG  MSGID(CPF9897) MSGF(QCPFMSG) MSGDTA('Sending +
                          SAVF' *BCAT &ODOBNM *BCAT 'in' *BCAT +
                          &ODOBNM *BCAT 'to' *BCAT &TOSERVER *BCAT +
                          'system.') TOPGMQ(*EXT) MSGTYPE(*STATUS)

                 /*  FTP/Send the just created save file to the target server  */
                 /*  NOTE: FTPFILE is in RPGREPORT, typically.                 */
             FTPFILE    RMTSYS(&TOSERVER) PUTGET(*PUT) +
                          LCLFILE(&MIGLIB/&ODOBNM) USER(&USER) +
                          PWD(&PWD) LOG(&MIGLIB/QFTPLOG) +
                          LOGMBR(&ODOBNM)
             ENDDO
             GOTO   READNEXT
 EOF:
                 /*  Once user libraries have been saved and sent,  */
                 /*  save the User Profiles via the "security data" */
                 /*  command: SAVSECDTA; also to a save file.       */
             SNDPGMMSG  MSGID(CPF9897) MSGF(QCPFMSG) MSGDTA('Saving +
                          User Profiles') TOPGMQ(*EXT) MSGTYPE(*STATUS)
             SNDPGMMSG  MSGID(CPF9897) MSGF(QCPFMSG) MSGDTA('Saving +
                          User Profiles')
             CRTSAVF    FILE(&MIGLIB/SECDATA) TEXT('User Profiles +
                          and Security Data')
             SAVSECDTA  DEV(*SAVF) SAVF(&MIGLIB/SECDATA) CLEAR(*ALL) +
                          DTACPR(*YES)

                 /*  Send the saved security data to the target server  */
             FTPFILE    RMTSYS(&TOSERVER) PUTGET(*PUT) +
                          LCLFILE(&MIGLIB/SECDATA) USER(&USER) +
                          PWD(&PWD) LOG(&MIGLIB/QFTPLOG) +
                          LOGMBR(SECDATA)

                 /*  Create a CL Source Member with the DEV configuration in it  */
             CRTSRCPF   FILE(&MIGLIB/QCLSRC) RCDLEN(112)
             MONMSG     MSGID(CPF0000)
             RTVCFGSRC  CFGD(*ALL) CFGTYPE(*ALL) +
                          SRCFILE(&MIGLIB/QCLSRC) SRCMBR(CONFIG)
             FTPFILE    RMTSYS(&TOSERVER) LCLFILE(&MIGLIB/QCLSRC) +
                          LCLMBR(CONFIG) USER(&USER) PWD(&PWD) +
                          LOG(&MIGLIB/QFTPLOG) LOGMBR(CONFIG)

                 /*  ADD NEW CONTENT TO BE MIGRATED, HERE  */

             SNDPGMMSG  MSG('Finished Migration  WRKJOB' *BCAT +
                          &JOBNBR *TCAT '/' *TCAT &JOBUSER *TCAT +
                          '/' *TCAT &JOBNAME) TOMSGQ(*SYSOPR)

                 /*******************************************************/
                 /*  NOTE: After transfer/migration, the save files     */
                 /*        on the target server will need to be         */
                 /*        restored by someone.                         */
                 /*        Recommend restoring the User Profiles first  */
                 /*        followed by the user libraries. If this      */
                 /*        sequence for restoring is not followed,      */
                 /*        then objects owned by user profiles will     */
                 /*        get changed to QSECOFR and the *PUBLIC       */
                 /*        authority will be set to *REVOKE.            */
                 /*        Meaning, we'd be screwed and would           */
                 /*        probably have to Restore the User Profiles   */
                 /*        followed by rerunning the user library       */
                 /*        restore process.                             */
                 /*******************************************************/
 ENDPGM:     ENDPGM 

On the new machine, you basically restore the authorities first, because the user profiles are installed, then restore the libraries in the save files.

The restore CL script that I used, follows:

RESTORESYS CL Source

This is for example purposes only. Your actual script is up to you.

 RESTORESYS: PGM        PARM(&FROMLIB)
             DCL        VAR(&FROMLIB) TYPE(*CHAR) LEN(10)
             DCL        VAR(&MIGLIB) TYPE(*CHAR) LEN(10)
             DCL        VAR(&DFTLIB) TYPE(*CHAR) LEN(10) +
                          VALUE('SYSMIGRATE')
             DCL        VAR(&OMIT) TYPE(*CHAR) LEN(10)
             DCL        VAR(&LEN) TYPE(*DEC) LEN(15 5) VALUE(255)
             DCL        VAR(&CMD)  TYPE(*CHAR) LEN(255)
             DCL        VAR(&PATH) TYPE(*CHAR) LEN(255)
             DCL        VAR(&USER) TYPE(*CHAR) LEN(10) VALUE('QDFTOWN')
             DCL        VAR(&PWD) TYPE(*CHAR) LEN(10) VALUE('QDFTOWN')

             DCL        VAR(&JOBUSER) TYPE(*CHAR) LEN(10)
             DCL        VAR(&JOBNAME) TYPE(*CHAR) LEN(10)
             DCL        VAR(&JOBNBR) TYPE(*CHAR) LEN(6)

             DCLF       FILE(QADSPOBJ)
             MONMSG     MSGID(CPF0000)

             CHGJOB     LOG(3 00 *MSG) LOGCLPGM(*YES)
             RTVJOBA    JOB(&JOBNAME) USER(&JOBUSER) NBR(&JOBNBR)
             SNDPGMMSG  MSG('Started Migration. WRKJOB' *BCAT +
                          &JOBNBR *TCAT '/' *TCAT &JOBUSER *TCAT +
                          '/' *TCAT &JOBNAME) TOMSGQ(*SYSOPR)

             CHGVAR     VAR(&MIGLIB) VALUE(&FROMLIB)
             MONMSG     MSGID(MCH0000) EXEC(DO)
                CHGVAR     VAR(&MIGLIB) VALUE(&DFTLIB)
             ENDDO

             ADDLIBLE   LIB(RPGREPORT)  /* FTPFILE cmd is in RPGREPORT */

             CHKOBJ     OBJ(&MIGLIB) OBJTYPE(*LIB)
             MONMSG     MSGID(CPF9800) EXEC(DO)
             SNDPGMMSG  MSGID(CPF9898) MSGF(QCPFMSG) +
                          MSGDTA('Library' *BCAT &MIGLIB *BCAT 'NOT +
                          FOUND. Restore cancelled.') MSGTYPE(*DIAG)
             return
             ENDDO

             CHGCURLIB  CURLIB(&MIGLIB)

                 /* First restore the user profiles  */
             RSTUSRPRF  DEV(*SAVF) USRPRF(*NEW) +
                          SAVF(&MIGLIB/SECDATA) ALWOBJDIF(*ALL)

                 /* List all the user libraries to be migrated */
             DSPOBJD    OBJ(&MIGLIB/*ALL) OBJTYPE(*FILE) +
                          OUTPUT(*OUTFILE) OUTFILE(&MIGLIB/&MIGLIB)
             OVRDBF     FILE(QADSPOBJ) TOFILE(&MIGLIB/&MIGLIB)
 READNEXT:   RCVF       RCDFMT(QLIDOBJD)
             MONMSG     MSGID(CPF0864) EXEC(GOTO EOF)
                 /* Read each user library name, skipping those we  */
                 /* want to filter out.                             */
             IF  ((&ODOBNM *NE ' ') *AND +
                  (&ODOBNM *NE &MIGLIB) *AND +
                  (&ODOBNM *NE &OMIT)   *AND +
                  (%SST(&ODOBNM 01 03) *NE 'MOV') *AND +
                  (%SST(&ODOBNM 01 03) *NE 'SAV') *AND +
                  (%SST(&ODOBNM 01 01) *NE 'Q') *AND +
                  (%SST(&ODOBNM 01 01) *NE '#')) THEN(DO)

                SNDPGMMSG  MSGID(CPF9897) MSGF(QCPFMSG) +
                          MSGDTA('Restoring library' *BCAT &ODOBNM +
                          *BCAT 'from save file' *BCAT &ODOBNM +
                          *BCAT 'in' *BCAT &MIGLIB) TOPGMQ(*EXT) +
                          MSGTYPE(*STATUS)

                 /* Restore the library from the save file   */
                RSTLIB    SAVLIB(&ODOBNM) DEV(*SAVF) +
                          SAVF(&MIGLIB/&ODOBNM) MBROPT(*ALL) +
                          ALWOBJDIF(*ALL) FRCOBJCVN(*YES *RQD)
             ENDDO
             GOTO   READNEXT
 EOF:
                 /*  Once user libraries have been restored,        */
                 /*  create the Configuration objects.              */
             UPDSYSINF  LIB(SYSCONFIG) /* To save the remote +
                          system's config, run RTVSYSINF LIB(SYSCONFIG) +
                           on that remote system */
             MONMSG     MSGID(CPF0000)

                 /*  Create a CL Source Member with the DEV configuration in it  */
             CRTCLPGM   PGM(&MIGLIB/CONFIG) SRCFILE(&MIGLIB/QCLSRC) +
                          TEXT('Create Device Desc from +
                          old system onto the new sys') LOG(*YES)
             CALL       PGM(&MIGLIB/CONFIG)
             MONMSG     MSGID(CPF0000)

                 /*  Last, restore user athorities         */
             RSTAUT     USRPRF(*ALL)


                 /*  ADD NEW CONTENT FOR MIGRATION HERE    */

             SNDPGMMSG  MSG('Completed Restore. WRKJOB' *BCAT +
                          &JOBNBR *TCAT '/' *TCAT &JOBUSER *TCAT +
                          '/' *TCAT &JOBNAME) TOMSGQ(*SYSOPR)

                 /*******************************************************/
                 /*  NOTE: After transfer/migration, the save files     */
                 /*        on the target server will need to be         */
                 /*        restored by someone.                         */
                 /*        Recommend restoring the User Profiles first  */
                 /*        followed by the user libraries. If this      */
                 /*        sequence for restoring is not followed,      */
                 /*        then objects owned by user profiles will     */
                 /*        get changed to QSECOFR and the *PUBLIC       */
                 /*        authority will be set to *REVOKE.            */
                 /*        Meaning, we'd be screwed and would           */
                 /*        probably have to Restore the User Profiles   */
                 /*        followed by rerunning the user library       */
                 /*        restore process.                             */
                 /*******************************************************/
 ENDPGM:     ENDPGM 

 

 

Call Me

Bob Cozzi has been providing the solutions to midrange problems, in the form or articles and books since 1983. He is available for consulting/contract development or on-site RPG IV, SQL, and CGI/Web training. Currently many shops are contracting with Cozzi for 1 to 3 days of Q&A and consulting with their RPG staff. Your staff gets to ask real-world questions that apply to their unique development situations. To contact Cozzi, send an email to: bob at rpgworld.com

You can subscribe to RPG Report (we call it "follow") by visiting the RPG Report page on midrangeNews.com and then click the FOLLOW link in the table of contents for that page. To unsubscribe, simply click that same link. You must be signed up and signed in to midrangeNews.com to start following RPG Report.

Follow Bob Cozzi on Twitter

Return to midrangenews.com home page.
Sort Ascend | Descend

COMMENTS