Operating System - HP-UX
1819791 Members
3245 Online
109607 Solutions
New Discussion юеВ

migrate printers to RH under CUPS config

 
SOLVED
Go to solution
Rick Garland
Honored Contributor

migrate printers to RH under CUPS config

All:

We have a HPUX 11.x print server right now. All if working OK.

We will be having a project to setup a RH Linux system as the print server. The Linux will be running CUPS as well.

How to migrate the printers from HPUX to Linux/CUPS? I can get printer names from the HPUX, but where to put them in Linux/CUPS?

Thanks
5 REPLIES 5
Vipulinux
Respected Contributor

Re: migrate printers to RH under CUPS config

Hi

Pls have a look at the follwoing files:
Under /etc/cups
1.cupsd.conf
2.printers.conf
3.clinet.conf

Hope this info is useful

Rgds
Ralph Grothe
Honored Contributor

Re: migrate printers to RH under CUPS config

If you're familiar with SysV printer administration you can still use lpadmin with the same set of options and arguments.
CUPS offers the same set of lp* commands for administration and printer/job handling.

I even think it comes with BSD like implementations.

However, probably the easiest way to do single task would be using a Webbrowser and connect to Port 631 over IPP.
There must be toolsets for all sorts of scripting languages for IPP that are more suited for bulk operations.

Maybe you could start here:

http://www.cups.org/doc-1.1/sam.html#MANAGING_PRINTERS
Madness, thy name is system administration
Paul Cross_1
Respected Contributor

Re: migrate printers to RH under CUPS config

I did a large implementation of CUPS a while back and found that CUPS provides no migration tool from lp.

I had to write a script that did an lpstat -a and extracted the printer names into lpadmin. When adding printers though, CUPS' lpadmin requires the ppd file as an argument. Each printer has a different PPD file (if you require the printer specific options). You can only script this if you have a way to map the printername to the physical characteristics of the printer, such as a printer inventory.
I was only able to do this because we keep a printer inventory with the printer name, model, location, etc. I was easily able to map a PPD file to each type of printer (we also had a limited number of printer types).

This could also be done if you have an intelligent printer naming convention IE: For us, hpljxxx is an HP with jetdirect. To which CUPS prints to port 9100 as opposed to 631 (IPP).

-paul
Joe Harrison_1
Advisor
Solution

Re: migrate printers to RH under CUPS config

Try this on the HPUX 11.x server:

Ex: hp2cups printers.conf

##############################################
#!/bin/sh

outfile=$1
if [ -z "$outfile" ]
then
echo "USAGE: hp2cups "
exit 1
else
> $outfile
fi

/usr/sam/lbin/lpmgr | while read printnfo
do
isremote=`echo $printnfo \
| cut -d":" -f3 \
| cut -d"," -f1`
if [ "$isremote" = "yes" ]
then
name=`echo $printnfo | cut -d":" -f1`
remote=`echo $printnfo \
| cut -d":" -f5 \
| awk '{print $3}'`
cat >> $outfile << EOF

Info Created by $USER
DeviceURI lpd://$remote/text
Location
State Idle
Accepting Yes
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0

EOF
fi
done
#########################################

Substitute DeviceURI with the appropriate protocol info (this should work for ldp).
Replace /etc/cups/printers.conf on the linux server with the file created by this script and restart cupsd.
Rick Garland
Honored Contributor

Re: migrate printers to RH under CUPS config

I admit it is not the most straightforward of migration but a word to the CUPS developers - have a import/migration path available.

Thanks all