• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Admin Alert: Moving Libraries Between i5/OS Partitions, Part 2

    March 1, 2006 Joe Hertvik

    In my last column, I presented the first half of a template for moving libraries between i5/OS partitions, covering how to prepare data for movement and detailed steps for saving a library to a save file. This week, I conclude the plan, showing you how to complete the transfer through FTP, restoring your library to the target system, and checking the results.

    To review, my plan for moving libraries between systems contained the following five steps:

    1. Prepping the data to be moved
    2. Saving the library to be moved
    3. Transferring the saved library to the new partition or machine
    4. Restoring the saved library to the target system
    5. Checking your results

    This plan will work on all versions of the i5/OS V5 operating system, as well as for earlier versions of the OS/400 V4 operating system. I reviewed the first two steps of the plan in my last column; this week, I will finish the procedure.

    Step 3: Transferring the Saved Library to the New Partition or Machine

    After you performed the second step, you have created a save file that contains an entire library that will be moved to your target system and restored. The easiest way to transfer the saved library is through FTP. Fortunately, moving save files between different partitions is a relatively routine process that requires you to perform a few simple steps on both the source system, where the library has been saved, and on the target system, where the library will be moved to.

    For simplicity’s sake, let’s assume that TCP/IP is up and running on both systems, which is pretty much a given in most shops. Next, you need to make sure that the i5 or iSeries FTP server is running on both systems. To do that, you can issue the following Start TCP/IP Server command (STRTCPSVR) on each partition.

    STRTCPSVR SERVER(*FTP)

    It won’t hurt if the FTP server is already running when you issue this command. Once you are sure that FTP is available, make sure that you have the following pieces of information before you transfer the save file to your target system. You will use all of this information as you perform your FTP transfer.

    • Name of the save file to be transferred and the library it resides in (source_save_file_name and source_save_file_library)
    • Name of the library on the target system that you will be transferring the save file to (target_save_file_library)
    • DNS name or IP address of the i5/OS partition where the save file will be transferred

    If the save file that you are transferring to the target partition already exists on that partition, be sure to clear it before you initiate the transfer or the transfer will fail. To clear an existing save file, execute the following Clear Save File command (CLRSAVF).

    CLRSAVF FILE(target_save_file_library/target_save_file_name)

    If the save file does not exist in the target library on the target partition, you do not have to worry about creating it; the FTP transfer script will create the file for you.

    When you have your information and you have cleared your target partition save file (if it exists), start an FTP session from your source system. You can do this by running one of the following two FTP commands.

    FTP RMTSYS(DNS_name_of_target_partition)

    Or

    FTP RMTSYS(‘nnn.nnn.nnn.nnn‘)

    Where nnn.nnn.nnn.nnn is equal to the IP address of the partition you will be transferring the save file to. As you start the FTP session, FTP will ask you to sign on to the target partition you are connecting to with a valid user ID and password for that partition. After you sign on to your FTP session, execute the following FTP sub-commands to transfer the save file.

    CD target_save_file_library
    LCD source_save_file_library
    BIN
    QUOTE SITE NAMEFMT 1
    PUT source_save_file_name.savf
    QUIT

    These are all the FTP sub-commands you will need to easily transfer the save file containing your transferred library from the source system to the target system. Each of these sub-commands performs the following functions.

    CD target_save_file_library: This is the Change Working Directory or Library sub-command. Its purpose is to set the working directory on the target FTP server you are communicating with to the name of the library that you want to copy the save file into.

    LCD source_save_file_library: This is the Change Working Library or Folder sub-command, which changes the working directory on the partition you are running the FTP session on to the library name that you want to copy the save file from.

    BIN: The Binary sub-command tells FTP that this is a binary transfer, which copies the data bit by bit without performing any kind of file conversion on the save file data as it moves the file to the target system.

    QUOTE SITE NAMEFMT 1: The Select Naming Format sub-command tells FTP to use the integrated file system format for designating files to be moved through this FTP session. This is critical for insuring that your save file is transferred correctly to the target system.

    PUT source_save_file_name.savf: The PUT sub-command tells FTP to send the save file from the working library on the source system to the working library on the target system. The .savf designation attached to the end of the source_save_file_name tells FTP that this is a save file that is being transferred, according to the OS/400 Integrated File System naming format that we specified in the QUOTE SITE NAMEFMT 1 sub-command. If you don’t specify .savf at the end of your file name, FTP will treat this transfer as a regular file transfer and the save file information will be saved as a physical file, not as a save file.

    QUIT: Ends the FTP session with the remote system

    By running the FTP transfer with these sub-commands, your save file will be transferred cleanly to the target system, and the save file will be created on the target system if it doesn’t already exist there.

    Step 4: Restoring the Saved Library to the Target System

    At this point, you are 80 percent of the way toward transferring the library and all its data to the target system. Before you restore the library, check to make sure that the existing library doesn’t already exist on your system. If it does, make sure you backup the library before you start so that you can restore missing objects later, if needed.

    In the last article, the procedure called for creating and restoring the transferred library exactly as it will exist on the target system, so if the new library already exists on your target system, your best bet for a clean restore is to rename the original library that will be replaced and then restore the new library complete and intact from your save file.

    If you want to rename a library to be replaced, run the Rename Object command (RNMOBJ) like this:

    RNMOBJ OBJ(Library_name) OBJTYPE(*LIB) NEWOBJ(new_library_name)

    And this will rename your existing library to a new name, retaining all the objects and authorities associated with that library.

    To restore your library from the save file that you transferred over from your source system, use the Restore Lib command (RSTLIB) like this:

    RSTLIB SAVLIB(library_name) DEV(*SAVF) SAVF(target_save_file_library/source_save_file_name)

    If you renamed the replaced library or the restored library does not already exist on your system, this command will restore an exact duplicate of your saved library to your target system. If you need to restore your library objects over objects in an existing library, be sure to fill in valid RSTLIB values for the Data base member option (MBROPT) and Allow object differences (ALWOBJ) parameters. These parameters determine how RSTLIB will restore saved objects over any objects that may exist in your target library.

    Also note that, because this library was created on a different system, RSTLIB may change some object authorities on the restored libraries and objects to match the user profiles that are available on the new system. This means that you may need to change object owners and user authorities to match the needs of your target partition. This specific task will differ from library restore to library restore, so for general techniques on changing ownership and authorities for a large number of objects in a single library, check out Changing Object Authorities and Owners for an Entire Library and Quicker Ways to Change Library Object Ownership.

    Step 5: Checking Your Results

    At this point, you have moved a library from one i5/OS partition to another. If you want to make sure that you moved all the objects over, you can run a Display Library command (DSPLIB) like this on both systems:

    DSPLIB LIB(library_name)

    And check the number of objects listed in each library on each system. If the number of objects in each library is the same, your transfer completed normally. If the numbers are different, you will want to investigate and make some adjustments.

    Finally, I recommend that you should also check and print the job log of the job you used for restoring the library, to ensure that no errors occurred in the process. One error that you may want to watch out for is a failure to restore logical files that were built over physical files that resided in a different library on your source partition. When this happens, i5/OS will not be able to restore those files, and you will have to make different arrangements to move those objects. For information on how to print out a job log, see Creating a Bread Crumb Trail for OS/400 Installs.

    RELATED STORIES

    Changing Object Authorities and Owners for an Entire Library

    Creating a Bread Crumb Trail for OS/400 Installs

    Moving Libraries Between i5/OS Partitions, Part 1

    Quicker Ways to Change Library Object Ownership

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Tags:

    Sponsored by
    New Generation Software

    FREE Webinar:

    Creating Great Data for Enterprise AI

    Enterprise AI relies on many data sources and types, but every AI project needs a data quality, governance, and security plan.

    Wherever and however you want to analyze your data, adopting modern ETL and BI software like NGS-IQ is a great way to support your effort.

    Webinar: June 26, 2025

    RSVP today.

    www.ngsi.com – 800-824-1220

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Sponsored Links

    nuBridges:  Leading provider of secure FTP on the iSeries
    COMMON:  Join us at the Spring 2006 conference, March 26-30, in Minneapolis, Minnesota
    BCD:  Try WebSmart - the easiest and most complete iSeries Web development tool

    TomorrowNow Upset at Quest User Group OS/400 Servers Over Time: Stacking Up the Big Boxes

    Leave a Reply Cancel reply

Volume 6, Number 9 -- March 1, 2006
THIS ISSUE SPONSORED BY:

ProData Computer Services
Advanced Systems Concepts
WorksRight Software

Table of Contents

  • A (Relatively) Easy Way to Process Parameters as an Array
  • Omit Commas from Numeric Dates
  • Admin Alert: Moving Libraries Between i5/OS Partitions, Part 2

Content archive

  • The Four Hundred
  • Four Hundred Stuff
  • Four Hundred Guru

Recent Posts

  • Public Preview For Watson Code Assistant for i Available Soon
  • COMMON Youth Movement Continues at POWERUp 2025
  • IBM Preserves Memory Investments Across Power10 And Power11
  • Eradani Uses AI For New EDI And API Service
  • Picking Apart IBM’s $150 Billion In US Manufacturing And R&D
  • FAX/400 And CICS For i Are Dead. What Will IBM Kill Next?
  • Fresche Overhauls X-Analysis With Web UI, AI Smarts
  • Is It Time To Add The Rust Programming Language To IBM i?
  • Is IBM Going To Raise Prices On Power10 Expert Care?
  • IBM i PTF Guide, Volume 27, Number 20

Subscribe

To get news from IT Jungle sent to your inbox every week, subscribe to our newsletter.

Pages

  • About Us
  • Contact
  • Contributors
  • Four Hundred Monitor
  • IBM i PTF Guide
  • Media Kit
  • Subscribe

Search

Copyright © 2025 IT Jungle