1823084 Members
3500 Online
109646 Solutions
New Discussion юеВ

Migrate Print Queues

 

Migrate Print Queues

I want to migrate around 350 Print queues from AIX to HP-UX.

Most printers are connected using HP Jetdirect on Aix Machines ( LAser printers as well as line printers - dump model)

Is there any scripts/commands which be helpfull for me to migrate the entire print queue

Thanks in advance

Ajay
4 REPLIES 4
Mridul Shrivastava
Honored Contributor

Re: Migrate Print Queues

Have a look at the following forum, may be useful:

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1064849
Time has a wonderful way of weeding out the trivial
Peter Nikitka
Honored Contributor

Re: Migrate Print Queues

Hi,

there is a utility named '/opt/hpnpl/bin/transferqueue'. The documentation states:
>>
transferqueue transfers queues from one machine to another
by retaining the configuration options that were set through
Unix JetAdmin/JetDirect Printer Installer Utility. This
script will ONLY transfer queues from HP-UX 10.x/11.x to
HP-UX 10.x/11.x or Solaris 2.x to Solaris 2.x. Transfered
queues will only work in Network Printer Installer for Unix.
<<

It does not explicitly tell us about AIX, but I would try...

mfG Peter
The Universe is a pretty big place, it's bigger than anything anyone has ever dreamed of before. So if it's just us, seems like an awful waste of space, right? Jodie Foster in "Contact"
Geoff Wild
Honored Contributor

Re: Migrate Print Queues

I did this a long time ago...

Steps taken to originally create the queues:

Ran the following script on aix:
printer.name.list >printer.name.list.out

#!/bin/sh
# Display all physical printers
exec 0while read line
do
p=`echo ${line}|awk -F_ '{print $1}'`
ip=`nslookup ${p} |grep 156|grep -v 192.168.1.10 |awk -F: '{print $2}'`
echo ${p} ${ip}
done

192.168.1.10 = your primary dns server on AIX...

Transfered printer.name.list.out to iprprt.

Ran the following script on iprprt:
/opt/hpnpl/queue-admin addqueue

#!/bin/sh
# script to add-delete queues
# Geoff Wild
#
if [ $# -lt 1 -o ( $# -gt 1 -a $# -lt 4 ) ]
then
echo "Usage:"
echo "queue-admin "command""
echo "Example:"
echo "queue-admin addqueue"
echo "queue-admin removequeue"
exit 1
fi


if [ $1 = "addqueue" ] ; then
exec 0while read line
do
p=`echo ${line}|awk '{print $1}'`
echo "adding queue " ${p}
# 9998 is net_genericprinter Modelscript
$1 -i 9998 -h ${p}.pcacorp.net -q ${p}
done
else
lpshut
exec 0while read line
do
p=`echo ${line}|awk '{print $1}'`
echo "removing queue " ${p}
lpadmin -x${p}
done
lpsched
fi

That created all the SAP printers using the Generic Printer Model Script (9998).

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.
Bill Hassell
Honored Contributor

Re: Migrate Print Queues

Unless you are using custom code on the AIX system, there is no compatibility between the two OS's for print queues. On the AIX side, you need to develop a file of printer names and IP addresses, like this:

laser21 12.34.56.78
laser44 23.45.67.89

etc. The AIX system is talking to the HP printers using lpr/lpd protocol and not the preferred HP protocol using port 9100. But there is a very useful program on HP-UX that will create each printer queue from just those two parameters: addqueue. So using awk, you can change the file to read something like this:

addqueue -q laser21 -h 12.34.56.78
addqueue -q laser44 -h 23.45.67.89

Then just run the above as a script on HP-UX and you'll have all your queues built with the advantage of a significantly larger selection of options (see man net_ljx000)


Bill Hassell, sysadmin