Admin Alert: Copying IFS Files from One iSeries to Another
by Joe Hertvik
In OS/400 shops with multiple iSeries and AS/400 machines, there's always a need to copy Integrated File System, or IFS, data between machines. And as OS/400 continues to host more stream-file-based applications, like IBM Lotus Domino and WebSphere, that need becomes more important, but a standard file transfer utility like FTP can make your transfers easier.
Copying stream file data between two iSeries or AS/400 boxes is a fairly simple procedure that. I'll present a simple example in which an index.htm file is transferred between the /home/ftp directory of one iSeries server (called ftpsrv400, in a domain named dummydomain.com) to the /home/ftp directory of an AS/400 machine (called ftpcln40, which also resides in dummydomain.com). [Note: To reproduce these examples in your own environment, change the machine and IFS directory names to match that of your OS/400-based servers].
First, start your iSeries FTP servers. You do this by using the Start TCP/IP Server (STRTCPSVR) command, specifying *FTP in the Server application (SERVER) parameter, as follows:
Your FTP servers can also be started by using iSeries Operations Navigator.
Now use the AS/400 server named ftpcln400 (the FTP client machine) to initiate an FTP session with the ftpsrv400 iSeries server (the FTP server machine) by using the FTP green-screen command on ftpcln400, as follows:
This command will open an FTP session with the ftpsrv400 server. You could also open that session by using the ftpsrv400 server's short name, if there's an entry in a corresponding DNS server or the iSeries' host table. Another option for opening the session would be to use the remote server's IP address. To perform either of these functions, use one of the following FTP command variants:
FTP RMTSYS(*INTNETADR) IPADDR('220.127.116.11')
To perform the file transfer, execute the following FTP subcommand script from inside the FTP shell:
NAMEFMT 1 CD /home/ftp LCD /home/ftp ASCII PUT index.htm index.htm QUIT
For a complete description of FTP subcommands, see "Admin Alert: The OS/400 FTP Subcommand Glossary." Here's how the different FTP subcommands work out in my example.
Using an FTP PUT subcommand isn't the only way to move stream files between boxes, however. While a PUT copies (puts) a file from the FTP client (ftpcln400, in this case) to an FTP server (ftpsrv400), an FTP GET subcommand reverses the direction and retrieves (gets) a file from the server and copies it back to the client.
So to change the example to use a GET subcommand to bring the file back to the client, change the subcommand script to the following:
NAMEFMT 1 CD /home/ftp LCD /home/ftp ASCII GET index.htm index.htm (REPLACE QUIT
Note that the REPLACE parameter on the GET subcommand tells OS/400 FTP to replace the index.htm file if it already exists in the target IFS directory.
To modify these transfers to retrieve files from other IFS locations, change the CD and LCD statements to designate the IFS address of directories in different IFS file systems. Here are some examples of how to designate the /home/ftp folder to point to different IFS file systems in CD, LCD, GET, and PUT subcommands.
To designate files in the QDLS file system, which contains document library objects, you could use the following syntax in the subcommands:
CD /QDLS/HOME/FTP LCD /QDLS/HOME/FTP GET /QDLS/HOME/FTP/index.htm /QDLS/HOME/FTP/index.htm (REPLACE PUT /QDLS/HOME/FTP/index.htm /QDLS/HOME/FTP/index.htm
To copy files from directories in the QOpenSys IFS file system, use the following syntax:
CD /QOpenSys/home/ftp LCD /QOpenSys/home/ftp GET /QOpenSys/home/ftp/index.htm /QOpenSys/home/ftp/index.htm (REPLACE PUT /QOpenSys/home/ftp/index.htm /QOpenSys/home/ftp/index.htm
Be careful when transferring files into and out of QOpenSys, because it's the only IFS file system where directory and file names are case-sensitive. If you don't observe proper case-sensitivity, you could easily produce errors in your FTP transfers or create duplicate files that contain different upper- and lower-case naming patterns (such index.htm and Index.htm).
So there's really no magic in transferring files between IFS locations. All it takes is a basic familiarity with FTP and a little experimentation.
Contact the Editors
|Copyright © 1996-2008 Guild Companies, Inc. All Rights Reserved.|