Moving entire libraries

When your library structure is organized to separate volatile information (for example, database files) from static information (for example, programs), this synchronization method might be simple and effective. You can periodically restore entire database file libraries from your existing system to your new system.

Note: Do not use this method for IBM-supplied (Qxxx) libraries, for example, libraries QSYS2, QGPL, and QUSRSYS.

Here is an example of the steps for moving a library:

  1. On your existing system, sign on with the QSECOFR user profile to avoid authority problems.
  2. Place your existing system in a restricted state to ensure that you get a fixed (static) copy of the database files.
  3. Use the Save Security Data (SAVSECDTA) command to save all user profiles. You use this information to correctly synchronize ownership and authority for any new objects that you move.
  4. Use the Save Library (SAVLIB) command to save the libraries to tape:
    SAVLIB LIB(library-name) DEV(tape-device)
       ENDOPT(*LEAVE) ACCPTH(*YES)
    Notes:
    • Specify ENDOPT(*REWIND) when you save the last library.
    • You can specify multiple libraries on the SAVLIB command.
  5. Restart the controlling subsystem on your existing system.
  6. On your test system, sign on with the QSECOFR user profile to avoid authority problems.
  7. Place your new system in a restricted state to ensure that you do not have restore problems because of object-locking conflicts.
  8. Use the Clear Library (CLRLIB) for each library that you plan to restore. This eliminates any potential problems with objects not restoring because of mismatches between the media version and the system version.
    Note: If you restore a library that contains Structured Query Language (SQL) collections that contain *DTADCT objects, for each of these libraries use the Delete Library (DLTLIB) command. (Use the DLTLIB command rather than the Clear Library (CLRLIB) command.) SQL collections that contain *DTADCT objects will fail during the Restore Library (RSTLIB) operation unless you first delete the library.
  9. To restore the saved user profiles, use the Restore User Profiles (RSTUSRPRF) command:
    RSTUSRPRF USRPRF(*ALL) DEV(tape-device) ENDOPT(*LEAVE)
  10. If your new release is V4R3 or a newer release, you can omit this step. If your test system has a different serial number, use the Change User Profile (CHGUSRPRF) command to add *ALLOBJ special authority to user profiles, if necessary.
  11. For each library that you saved, use the RSTLIB command:
    RSTLIB SAVLIB(library-name) DEV(tape-device) MBROPT(*NEW)
       ENDOPT(*LEAVE) OPTION(*NEW) ALWOBJDIF(*ALL)
    Notes:
    • If you have a different auxiliary storage pool (ASP) organization on your new system, you might need to specify the SAVASP and RSTASP parameters.
    • You specify ALWOBJDIF(*ALL) because you might be restoring to a system with a different serial number. ALWOBJDIF(*ALL) links the authorization lists back with the objects. You should only specify ALWOBJDIF(*ALL) when you are restoring to an empty library or the library does not exist on the system.
    • When you restore the last library, specify ENDOPT(*REWIND) unless you have additional objects to restore from the tape.
  12. Check your job log to ensure that the system successfully restored the libraries.
  13. Use the Restore Authority (RSTAUT) command to restore private authorities to objects.