1832853 Members
3091 Online
110047 Solutions
New Discussion

Migrating printers.

 
SOLVED
Go to solution
Neil Harris
Regular Advisor

Migrating printers.

I have a need to migrate the printers on one machine to another. Is there a simple way of doing this, without having to create all the printer configurations on the new machine from scratch.
An inveterate hacker
6 REPLIES 6
eran maor
Honored Contributor

Re: Migrating printers.

Hi

HP does not support the copying of the lp spooler configuration from one system
to another. The IO configuration of the target system may be different than IO
configuration on the source system. The device files for local printers would
be different on the new system, and the spooler configuration for those
printers contain the device files. The print queues may not work.

A procedure that has been known to work in most circumstances is as follows :

On the source system:

Execute
-> SAM
-> Printers and Plotters
-> Lp Spooler
-> Save/Restore Spooler Configuration

Choose
-> Actions
-> Save Spooler Configuration

This will save all the information necessary to rebuild the spooler into the
directory /var/sam/lp.

Tar this directory (/var/sam/lp) :

# tar cvf /tmp/lp.tar /var/sam/lp

Copy the resulting tar file, lp.tar, onto the target system.

Unpack the lp.tar file on the target system :

# tar xvf lp.tar


Execute
-> SAM
-> Printers and Plotters
-> Lp Spooler
-> Save/Restore Spooler Configuration

Choose
-> Actions
-> Restore Spooler Configuration

This will build the lp spooler configuration on the target system using the
information from the source system, creating a "clone" of the old system.

An error may occur when restoring the spooler if the root umask is set to
something other than 022. The permission on /var/sam/lp and all file
under it could be changed from their defaults, 755 or rwxr-xr-x, with the result
that SAM cannot access the files to perform the restore. The error received in
SAMlog would be something like:

ERROR A problem occurred doing "lpadmin -ptrec_stor
-i/var/sam/lp/interface/trec_st or -v/dev/null ". Stderr from this command is
"/usr/sbin/lpadmin: can't access file "/var/sam/lp/interface/trec_stor"".
* Failed to restore trec_stor.
love computers
Jose Mosquera
Honored Contributor

Re: Migrating printers.

Hi,

Make in source machine: SAM/Printers and Ploters/LP Spooler/Save-RestoreSpooler Configuration/Action/Save Spooler Configuration.

Go to /var/sam/lp and tar avery dirs inside

ftp this tar file to the target host and put on /var/sam/lp

Before explode it on the target host delete first any dir inside. Now explode the tar file.

In target host SAM/Printers and Ploters/LP Spooler/Save-RestoreSpooler Configuration/Action/Restore Spooler

That's All..!

Rgds
Neil Harris
Regular Advisor

Re: Migrating printers.

Thank you for that Eran, I should also have said that there are prints already configured on the target machine. I am moving from 10.20 to 11.00, so I suspect from your words at the begining of the reply that I am going to have to do each one by hand.
An inveterate hacker
Jose Mosquera
Honored Contributor

Re: Migrating printers.

Neil,

I've migrated my whole printers in one step from 10.20 to 11.o without troubles with this method.

Rgds.
Pepe Jimenez Muñoz
Frequent Advisor
Solution

Re: Migrating printers.

I use scripts for generating all the printers.

For remote printers:

Generate a file with printers definition in system 10.20

lpstat -v | grep remote | cut -d" " -f 7,9 > /tmp/remote_printers

sed -e s/\ \/\|/g /tmp/remote_printers > /tmp/remote_printers2

Copy /tmp/remote_printers2 to system 11.11

lpshut


for i in `cat /tmp/remote_printers2`
do
a=`echo $i |cut -d"|" -f1`
b=`echo $i |cut -d"|" -f1`
lpadmin -p$a -orm$b -orp$a -mrmodel -v/dev/null -orc -ob3 -ocmrcmodel -osmrsmodel ;
done

lpsched


For DTC printers is similar, and for JETDIRECT printers you need the NAME and IP.

To obtain IP for JETDIRECT printer:

cat /etc/lp/interface/printer_name | grep ^PERI

PERIPH=10.72.2.4

Hope this help.

(Sorry for my poor english
ppviso
douglas stradford
Occasional Advisor

Re: Migrating printers.

I have done as suggested, but still am having no luck to get print to flow. Printers show on original system with location shoing --, but on new system they show /dev/null.

Is it possible there is a permission issue or something else to look for?

Thanks.

Doug