Guru: Move Objects with Access Client Solutions
October 14, 2019 Dawn May
Sending objects from one IBM i partition to another is a common task. Access Client Solutions’ IFS task makes it simple to copy or send objects. The IFS task was introduced in ACS in July 2016, so this is not a new development, but it may not be widely known.
Perhaps you need to send a save file to another IBM i partition. There are several ways to do this. FTP and Secure FTP are often used, but using FTP to transfer IBM i objects involves all sorts of complications. The IBM i Knowledge Center dedicates an entire section on data transfer methods and considerations when using FTP.
You can easily sidestep all this by using the ACS IFS task to send an object to another IBM i partition!
First, open the IFS task on each partition.
On the source partition, navigate to the directory where the object is stored – and remember that you can get to the QSYS.LIB file system through the IFS task.
On the target partition, navigate to the directory where you want to store the object. Now all you have to do is drag and drop the object from the source to the target. You can do this with stream files, objects in libraries (including save files), as well as library objects themselves. That’s it!
In addition to drag and drop, you can use copy/paste or send/receive objects between two IBM i partitions; under the covers they all do basically the same thing. The Send… dialog has some additional, useful options. Send…, which you will find under the View menu, has an option to send all objects, only new objects, or only existing objects. In addition, you can select multiple systems for the destination, sending the requested object to many partitions with a single request.
The screen capture below of the Send… dialog shows that you can select the destinations from your list of systems, as well as the options available.
The IFS task also provides an easy way to copy objects on a single partition. Let’s say I have a library with a lot of objects, and I want a subset of that library on my other partitions. I can use the IFS task in a similar manner to copy the desired objects from the large library to a second library on that partition, then easily send that second library to all of my other IBM i partitions.
ACS has a command line interface that allows you to automate actions or initiate them without using the main ACS GUI panel. There is an IFS plugin that allows you to copy and send objects, as well as the other IFS task actions, which would allow you to write scripts to automate moving objects around.
Section 9.12 in the Getting Started guide documents the prerequisites and lists the commands used under the covers to copy or send the objects. You must be authorized to the listed set of commands, as well as having the same user profile with the same password on all IBM i partitions. The QPWDLVL system value must be the same on all partitions involved. There is also the restriction in that you cannot move objects that reside in an independent ASP. Section 9.1.33 in the Getting Started guide documents the IFS plugin for the command line interface.
Access Client Solutions also allows you to transfer files between your IBM i and your PC. You can upload or download files with the IFS tasks or use data transfer. Uploading and downloading files does simply that — uploads or downloads a copy of the file. Data transfer allows you to transfer files to or from you PC for use in spreadsheets, and has been around for a long time.
We just got 2 additional partitions up and running and this article is exactly what I needed!
However, I have gotten an error that says ‘Failed to paste objects’ when using the drag and drop method. How do I know what is actually causing that error?
Hi Katrina,
Yes, I have also gotten that error during a drag and drop operation. In my case, the copy was successful, just the unexpected “Failed to paste objects” error. I have not investigated it further. I suspect the error should be reported to IBM.
Is there a way to automate this function? I am not able to find much documentation on /plugin=ifs. Would like to know if there is functionality to run this in a program (PowerShell, qsh, etc) to automate some functions. Desiring to be able to move files from one IBMi to another IBMi.
Anything you can find would be helpful.
I know this is an old post, but it is also about the only help I can find. The Getting Started guide helps, but not useful for troubleshooting.
“Failed to paste” error: I found messages hidden in the transient jobs that there was a problem with who owned the objects. (A common error with RSTOBJ).
Background: the sending system makes an OS SAVF, copies it to the IFS, copies that to the IFS on the receiving system. Then pulls that to a SAVF in QTEMP for the connection job and tries a restore.
After I got a pop-up error message, I found the transient job was having owner problems. Before answering the pop-up, I looked at the transient job and found the path it was using.
I made a copy the file from /tmp/IFS### and issued the commands myself to override the ownership issue. (And tried restoring to an empty library. Plus I only succeeded when I tried a fresh connection – error must have been cached.)
Now for my current problem: I am trying to copy only some QRYDFN’s, so I sort by mod’d date and try to copy. But sometimes I get an error:
“Cannot send files from an independent ASP.”
Since we only have 1 ASP on all systems, I don’t know what it means.
I either have to do a few objects at a time, and can eventually get them all, or do a SAVOBJ to *savf and use IFS to drag that. (What a pain!).
Anyone know why the system thinks there are more ASPs?