IBM Support

Using a Saved File to FTP Objects from IBM System i System to Another

Troubleshooting


Problem

This document provides the steps to create a save file and to use the File Transfer Protocol (FTP) to back up libraries or other objects from one IBM® System i® system to another operating system.

Resolving The Problem

Many users want to back up libraries or other objects from one IBM® System i® system to another System i® system. The easiest way to move all of the libraries is to use a save file and the File Transfer Protocol. 

To begin, create two saved files--one on System A and another on System B. Name these saved files the same name. In the following example, a saved file was created called SAVFLIB in library GARBERSB. This is done on System A and System B. 

On the operating system command line, type the following:

CRTSAVF FILE(GARBERSB/SAVFLIB)

Press the Enter key.

This picture shows the CRTSAVF command.

After the saved file is created, go to System A where the libraries and other objects you want to transfer are located. To put a library inside the newly created saved file, do a SAVLIB and specify the saved file as shown below:

SAVLIB LIB(GRANUM) DEV(*SAVF) SAVF(GARBERSB/SAVFLIB)

Press the Enter key.

This picture shows the SAVLIB command with appropriate fields entered.

Notice that we are putting a library called GRANUM into the saved file that we created.

To specify an object such as a specific file, on the operating system command line, type the following:

SAVOBJ OBJ(BOBFTP) LIB(GARBERSB) DEV(*SAVF) SAVF(GARBERSB/SAVFLIB) 

Press the Enter key.

This picture shows the SAVOBJ command with appropriate fields entered.

The object BOBFTP located in library GARBERSB is being saved in the saved file previously created. If information already resides in that saved file, you are prompted with a QSYSOPR message. Choose C or G to overwrite the objects that are already within that saved file. This is why it is important to create different saved files for different objects that you want to transfer from one system to another. 

Note: If you are transferring between systems on different operating system releases, the target release must be specified for the operating system to which you are sending the save file. 

To display what is in a saved file, on the operating system command line, type the following:

DSPSAVF FILE(GARBERSB/SAVFLIB)

Press the Enter key.

This picture shows the DSPSAVF command with appropriate fields entered.

To transfer a SAVF, do one of the following:

oPre-create a SAVF on the target machine with the same name as the SAVF you are sending.
oName Format 0 must be used.

Note: In this example, the IBM® System i® system is set to use Name Format 0.

The saved file must be FTPed from System A to System B. Do the following:

1To get an FTP session on System A, type the following:

FTP <OS/400 System B Hostname or IP Address>
2Sign on System B server with your user ID and password.
3Type LCD <local library where the saved file resides> which will put you in the library where your saved file is located on System A.
4Type CD <library where the saved file is on OS/400 System B> which will put you in the library that you created the other saved file on System B. 

Type type following:

NAMEFMT 0

You will receive two messages indicating that the name format is now 0.
5Transferring a saved file must be done in binary mode rather than ASCII. To switch to binary mode, type BIN.
6Type PUT <name of saved file>.


This picture shows the FTP transfer of the savf.


Log on the operating system FTP server. System B is called RCHASBDS. Go into the local library on System A by typing LCD garbersb. Then, type CD to the library where we want to transfer the saved file to which is also called garbersb. All files must be transferred in binary. To change to binary, type the BIN command. Then, type PUT specifying the saved file savflib.

To determine if the file got to System B successfully, go to RCHASBDS and type the following

DSPSAVF FILE(GARBERSB/SAVFLIB)

Press the Enter key.

This picture shows the DSPSAVF command with appropriate fields entered.

To get the object out of the saved file, type the following on the operating system command line. Specify the object to get out of the saved file (in this example, *ALL):

RSTOBJ OBJ(*ALL) SAVLIB(GARBERSB) DEV(*SAVF) SAVF(GARBERSB/SAVFLIB)

Press the Enter key.

This picture shows the RSTOBJ command with appropriate fields entered.

As you can see, all the objects from the saved library GARBERSB are being restored. The saved library is the library from System A where you originally put the objects in the saved file. In addition, specify the save file and library it resides in on System B. Savflib in library garbersb was specified to restore all the objects from the saved library garbersb. The objects restored are on the bottom left of the screen. 

If a library was put in the saved file, use the RSTLIB command rather than the RSTOBJ command. Specify the saved library and the saved file location. This restores the library on the operating system.

It is important to view the objects after they are restored. If it is a library, use the WRKLIB<libraryname> command. If it is an object, go into the library where it resides (the library where the saved file is), and look at that object.

[{"Type":"MASTER","Line of Business":{"code":"LOB68","label":"Power HW"},"Business Unit":{"code":"BU070","label":"IBM Infrastructure"},"Product":{"code":"SWG60","label":"IBM i"},"ARM Category":[{"code":"a8m0z0000000CLbAAM","label":"Communications-\u003EFTP"}],"ARM Case Number":"","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"6.1.0;7.1.0;7.2.0;7.3.0;7.4.0;7.5.0;7.6.0"}]

Historical Number

20655043

Document Information

Modified date:
28 October 2025

UID

nas8N1017661