Operating System - HP-UX
1832552 Members
6299 Online
110043 Solutions
New Discussion

Re: Transferring print queues

 
SOLVED
Go to solution
Jeff_Traigle
Honored Contributor

Transferring print queues

I've found several mentions of transferqueue for JetDirect queues. I've seen mention of going through the clunky SAM interface to save and restore spooler configurations. Is there anything to accomplish this strictly from the command line to include in a script? I've successfully done this from 11.00 to 11.00 by tarring /etc/lp and /var/spool/lp, but have a a few problems with this approach (and what SAM appears to do):

1. Does this work going from 10.01 or 10.20 to 11.00? (We still have older systems that could possibly be upgraded at some point.)

2. Even if it works, it is using old model files that may be updated in newer OS releases. There could be bug fixes or enhancements that would be missed in this manner. (Or bugs could be introduced because of using older model files on newer OS releases.)

3. It also doesn't handle the original model files in /usr/lib/lp. I wouldn't want to overwrite newer HP versions, but, in cases where model files for other types of printers may have been added to a system (likely no specifics known about them beforehand), some of these need transferred too.

Trying to do this in a script that requires as little interaction as possible to avoid errors and time-consuming manual processes now employed by our installers when migrating customers to new systems. I wrote a script to handle remote printers, but it's very specific to using HP model files. I don't see a good way offhand to deal with model files that don't have a "Source:" comment in them to look for. (And the way I wrote it won't properly handle any queues other thanthose created from PCL and generic remote models currently anyway.)

Any thoughts or insights to offer on any of the above points?
--
Jeff Traigle
5 REPLIES 5
Geoff Wild
Honored Contributor

Re: Transferring print queues

Here's what I do:

Server A:

/usr/sam/lbin/lpmgr
-S -v -xsavedir=/var/sam/lp/ ; cp -r -p /var/sam/lp/lp.new/* /var/sam/lp/

tar up /var/sam/lp/ and rcp/ftp to server B.

Server B:

/usr/sam/lbin/lpmgr -R -xsavedir=/var/sam/lp/

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: Transferring print queues

I typically do an lpstat -t and look for any stale printjobs and cancel them before the transfer. I would add that you need to do an lpshut before the transfer and install the newest JetDirect software on the target machine. You also need to get hostname resolution working on the target box.

My experience has been that if the printers were working well enough on 10.20, for example, they will work well enough with even obsolete interface files under 11.11. I've done this at least tens of times and all I ever do is cpio /etc/lp abd /var/spool/lp over (your use of tar, is of course fine as well). It is essential to preserve the modes and ownerships of these files so simple rcp's are out. You then run a transferqueue local command on the new box and respond "all" to update any old JertAdmin scripts to use the JetDirect commands.

The problem with trying to "blend in" new interface/model scripts is that it's not easy to know how they have been customized. If you need to use some new-fangled feature in a newer version of an interface, you can do that on an as-needed basis.


If it ain't broke, I can fix that.
Steve Steel
Honored Contributor

Re: Transferring print queues

Hi

Jetdirect does it itself

- 1 - Formatted: March 17, 2004

transferqueue(1) transferqueue(1)

NAME
transferqueue allows users to transfer all Unix JetAdmin/JetDirect
Printer Installer Utility created queues from one Unix host to another
in the JetDirect Printer Installer Utility environment.

SYNOPSIS
transferqueue [help/local/backup]

export MANPATH=/opt/hpnpl/man:$MANPATH
man transferqueue


See also
http://www.hp.com/pond/modelscripts/index2.html


Home of all jd printer scripts


Steve Steel

If you want truly to understand something, try to change it. (Kurt Lewin)
Jeff_Traigle
Honored Contributor

Re: Transferring print queues

Thanks for the info, guys. Looks like my best bet is to just transfer /etc/lp and /var/spool/lp as I've done previously between the 11.00 systems. transferqueue doesn't get the entire job done for us because a vast majority of the print queues set up on our customer's systems were done as remote instead of network... otherwise life would have been much simpler. :)
--
Jeff Traigle
Tor-Arne Nostdal
Trusted Contributor

Re: Transferring print queues

Hi,
I have created some scripts that help me do this. The scripts just do some checking and confirmation steps.

I define all printqueues on one server (Server A), then distribute it to the other servers (Server B).

1) Saving all printqueus on Server A
serverA# /usr/sam/lbin/lpmgr -S -xsavedir=/var/sam/lp
(this is the same place SAM uses as default when saving/restoring)

2) Removing old SAM on Server B
serverB# rm -r /var/sam/lp

3) Fetching queues from Server A
serverB# (cd /var/sam;tar cf - ./lp)"| (cd /var/sam;tar xf -)

4) Restoring printqueues on Server B
serverB# /usr/sam/lbin/lpmgr -R -xsavedir=/var/sam/lp

When you restore the queues on Server B all printqueues will be deleted from /etc/lp and recreated from the sam-directory.
Any pending spooljobs is deleted as well.

Related to model files:
The model file is copied from the repository into /etc/lp/interface/model.orig/{queuename} when you define the queue.
This will be saved and restored on Server B.
So in this case the same model file will be used on all servers.

I have used this between 10.x and 11.x servers. On Itanium servers 11.23 I had to do one adaption.
Risc/11.11 which is my source system refer to /opt/hpnp while Itanium uses /opt/hpnpl
In the /etc/lp/interface/{queuename} file this is specified HPNP=/opt/hpnp
So you could either change all occurences or just create a link (which I did)
ln -s /opt/hpnpl /opt/hpnp

Hope your still watching the message and that is to some help

Best regards
Tor-ARne
I'm trying to become President of the state I'm in...