Skip to main content

Moving Objects Between Systems Using SAVRST

The SAVRST* commands provide flexibility and ease of use when moving data between systems or partitions.

'Network Communications' in blurry letters overtop four pink patches with white lines connecting them.

I often have a need to move objects between different iSeries systems, or between LPARs on the same physical system. These objects could be traditional physical and logical files, IFS files, program objects, libraries, IFS directories or other OS/400 objects. Different techniques are available, depending on characteristics such as network topology, installed license programs, available devices and the system administrators preferences.

Some of transfer methods that could be used are included in OS/400, and are in one of three categories: system-based, Systems Network Architecture (SNA)-based or TCP/IP-based. The SNA-based Send Network File (SNDNETF) command enables you to transfer files and other objects (programs, etc,) if they are first saved in a save file, which is then transferred with SNDNETF. The save file must then be restored on the destination system. SNDNETF uses SNA Distribution Services (SNADS) and must be received on the destination side with the Receive Network File (RCVNETF) command. Note that some third-party commands use this technique; notably the Send Network Object (SNDNETOBJ) command.

The TCP/IP-based FTP command operates in a similar manner. A file can be transferred directly, while other objects must be saved into a save file and then restored on the destination system. FTP uses standard TCP/IP services, so only the TCP/IP Utilities (5722-TC1, a free part of OS/400) is needed.

Standard system-based commands include: 

  • SAV                            Save Object                
  • SAVCHGOBJ           Save Changed Objects       
  • SAVDLO                    Save Document Library Object
  • SAVLIB                      Save Library               
  • SAVOBJ                    Save Object
  • SAVSAVFDTA         Save Save File Data
  • SAVRSTCFG            Save Configuration 
  • SAVSYS                    Save System

These commands have corresponding Restore (RST*) equivalents to restore the object(s) on the destination system. These commands are commonly used to save objects to a tape, though objects can also be saved to a save file or an optical file. As mentioned earlier, a save file is often used when transferring objects using SNDNETF or FTP.

These techniques all have advantages and disadvantages. All are part of OS/400, so no additional software is required. The system-based commands allow many different save and restore options, such as saving to a previous release, saving changed objects (files) and saving non-file objects without the use of a save file. SNDNETF and FTP enable saved data to be sent across a network without a physical tape device. However, SNDNETF and FTP require intervention at the destination-a RCVNETF (for SNDNETF transfers) or a restore from a save file for non-file objects.

Really, what we need is the best of all worlds: Saving any type of object, sending information across the network easily with no intervention needed at the destination, and all the options that the system-based techniques provide. IBM has provided this capability with the Save/Restore (SAVRST*) commands. I most commonly use these commands to move data between systems. The Save/Restore commands are:

  • SAVRST                    Save Restore for IFS objects
  • SAVRSTCFG            Save Restore Configuration 
  • SAVRSTCHG           Save Restore Changed Objects
  • SAVRSTDLO            Save Restore Document Library Object
  • SAVRSTLIB              Save Restore Library       
  • SAVRSTOBJ                        Save Restore Object

Based on my needs, I use the SAVRSTOBJ command most often, followed by SAVRST and SAVRSTLIB. I rarely use SAVRSTDLO since I don't use folders and documents on the iSeries system. The SAVRST* commands provide the options of the system-based commands while supplying the transfer flexibility of the SNDNETF and FTP commands.

The SAVRST* commands are SNA-based commands. This means that their use requires a standard SNA configuration to be established between the source and destination systems. A standard SNA configuration should be established, probably over a LAN or WAN link. The SAVRST* commands can also AnyNet (SNA over TCP/IP) or OptiConnect (a high-speed link or HSL between systems), two different methods of connectivity. Basically, any connectivity method that enables the use of Display Station Pass-Through (the STRPASTHR command) between two systems will work for the SAVRST* commands.

Again, I use the SAVRST* commands to move the saved objects easily across a network and to restore the objects on the destination system. Heres an example of the SAVRSTOBJ command:





This saves the MKXL program from library MICHAEL, transfers the saved object to system DSTSYS and restores the program into library MICHAEL on the destination system. Figure 1 shows an example of saving multiple objects-all objects that begin with "MK" in library MICHAEL.

These objects will be restored into library MICHAEL on system DSTSYS. Note the message on the bottom of the display-it shows the job name on the destination system. This job controls the restore process-viewing the job log of the remote job can be helpful in troubleshooting. Figure 2 shows messages from the job on the local (sending) system. A status message is also displayed at the bottom of the screen that indicates the status of the transfer:

9 objects saved and restored.

Here's another example of using the SAVRST* command to save the objects as before, but in a previous release format (V5R1M0) and restore them to library OTHERLIB:

SAVRSTOBJ OBJ(MK*)           






The Target Release (TGTRLS) and Restore Library (RSTLIB) can be specified on the SAVOBJ and RSTOBJ commands respectively-an example of combining the save, transfer and restore capabilities of the SAVRST* commands.

Here's an example of saving, transferring and restoring a library:







Again, the combination of the SAVLIB and RSTLIB command parameters can be shown: Save Active (SAVACT) and Save Access Paths (ACCPTH) parameters are on the SAVLIB command, while Allow Object Differences (ALWOBJDIF) and RSTLIB are on the RSTLIB command.

The SAVRST command (for objects in the IFS) behaves as you would expect-a combination of SAV and RST commands, with the transfer from the source to the destination system happening between the save and restore. Parameters from both commands can be specified on the SAVRST command, such as the Objects to include or omit (OBJ parameter), the name Pattern (PATTERN parameter), the Directory Subtree (SUBTREE parameter) and the Allow Object Differences (ALWOBJDIF) parameter. Here's a simple example of the SAVRST command:

SAVRST RMTLOCNAME(DSTSYS) OBJ(('/michael/ifsfile.txt' *INCLUDE))

This command will save the /michael/ifsfile.txt object and restore it on system DSTSYS.

The SAVRST* commands provide flexibility and ease of use when moving data between systems or partitions. The many options on the SAV* and RST* command are available, and the transfer of the saved objects to the destination system is transparent to the user.


Stay on top of all things tech!
View upcoming & on-demand webinars →