Your Ad Here

IBM AIX/UNIX system storage administration ksh/perl scripting

Monday, March 16, 2009

Migrate print queues from one AIX server to the other

INTRODUCTION
------------
This technote describes an ** UNSUPPORTED ** method of migrating virtual
printer queues from one AIX system to another.
.
.
SCOPE
-----
Original document (author unknown) was written for migrating virtual
printer queues between AIX v3.2.5 and AIX v4.2.x and greater. It has
been used since for migrating virtual queues between like oslevels as
well as from AIX v4.x to AIX v5.1. Most recently, it was confirmed to
work for migrating virtual printer queues from AIX v4.3.3 to AIX v5.2.
.
.
VIRTUAL PRINT QUEUE MIGRATION
-----------------------------
Following, is the original document as taken from various closed PMRs.
(cleaned up a bit for readability)
.
========================================================================
.
SPECIAL NOTICES
.
Information in this document is correct to the best of our knowledge at
the time of this writing.
.
Please use this information with care. IBM will not be responsible for
damages of any kind resulting from its use.
The use of this information is the sole responsibility of the customer
and depends on the customer's ability to evaluate and integrate this
information into the customer's operational environment.


Migrating print queues from one system to another/os level independent.
(this only addresses the queue names and virtual printers). print
devices (lp's) must still be made independent of these actions and this
will not work for any queues with non-AIX backends or most network queue
connections (host names and routes being the primary issue). Also
depending on what kind of connection the queue has, the file and or
backend directory path in /etc/qconfig stanzas will be different between
os level 3.2.5 and 4.x.x
.
The reason there is no cut and dry answer to this issue is that
customer's systems vary so much in adapter/network connectivity,
filesystem structure, host naming conventions, etc., that years of
experience have taught us most people are much better off just making
the
queues via smit. A few hours work and it's done rather then 20 hours
later and still trying to figure out one more piece of the puzzle which
is stopping the cloned system from working.
.
SUGGESTION:
.
NOTE: Save all files which will be over-written by this process
before attempting the migration.
.
1. copy the /etc/qconfig to the target system.
.
2. cycle the printer subsystem on target machine.
stopsrc -cg spooler
startsrc -g spooler
.
3a.copy all the /var/spool/lpd/pio/ local/custom files to target
system (/var/spool/lpd/pio/custom for AIX 3.2.x)
.
3b.copy all the /var/spool/lpd/pio/ local/dev directory files
(this is the queue device place holder)
.
4. change the permission on the copied files in
/var/spool/lpd/pio/ local/custom to 664 and make ownership
of root owner and printq group.
.
5. digest the colonfiles:
.
Run the sm_file script below
.
OR
.
chvirprt -q(queue name) -d(device name) for each file in
/var/spool/lpd/pio/ local/custom
.
The sm_file Script:
.
#!/bin/ksh
echo " n n n n n n n n n n n n n n n n n n n n n n n n n n n n n"
echo "This operation will refresh the printing system smit screens"
echo "and relink the system queues to the new screens. To complete"
echo "the operation I will stop qdaemon and restart it after I am
done. n"
echo "Any job currently printing will start over from the begining. n"
echo "If you want me to continue with this operation type YES in
capital"
echo "letters, and hit . If not type NO and hit . n"
echo "Shall I continue?"
while read QSTOP
do

if -z $QSTOP tests for a null (just hit enter)
then
echo " n"
elif test $QSTOP = "NO"
then
echo "stopping with no change to smit queue screens"
exit exits this shell script
elif test $QSTOP = "YES"
then
break exits the while loop after the
fi

echo "Please enter NO or YES"
done
echo " n"
echo "Stopping qdaemon."
echo " n"
stopsrc -cs qdaemon
echo "I will now copy backup smit screen files to the directory of:"
echo "/var/spool/lpd/pio/ local/smit."
echo "one moment please... n"
sleep 5
cp /usr/lpp/printers.rte/inst_root/var/spool/lpd/pio/ local/smit/*
/var/spool/lpd/pio/ local/smit
echo "Done with smit screen refresh. n"
sleep 2
cd /var/spool/lpd/pio/ local/custom
echo "I will now link the currently existing queues on the system, with
the"
echo "refreshed smit screens. n"
sleep 3
for file in ls
do
echo "Now linking queue and device $file"
/usr/lib/lpd/pio/etc/piodigest $file
done
echo " n"
echo "Starting qdaemon"
startsrc -s qdaemon
echo " n"
echo "The print queue refresh/relink operation is complete. If you
have"
echo "any questions or problems please call: 1-800-225-5249 (AIX
SUPPORT)."
echo "Thank you for using AIX SUPPORT."
End of script
.
This has worked in a test environment but it is not guaranteed to work
in any particular OS or hardware environment. If it does not work,
return to the supported method of queue construction as laid out in the
AIX system manuals.
.

No comments:

Labels

Blog Archive

BlogCatalog