Operating System - HP-UX
1837379 Members
3019 Online
110116 Solutions
New Discussion

moving printers from one server to other.

 
SOLVED
Go to solution
blal
Frequent Advisor

moving printers from one server to other.

Hi

I have some 100 printers configured in One HP UX 11 server . I want to move the same to another server . I used sam and through command line .Both the time it failed giving the following err.

to save
/usr/sam/lbin/lpmgr -S -v -xsavedir=/tmp/lp
to restore. on remote node.
/usr/sam/lbin/lpmgr -R -v -xsavedir=/tmp/lp


The error mesg I am getting when restoring is

A problem occurred doing "lpadmin -pnirdotprn -i/tmp/lp/interface/nirdotprn -v/dev/null ". Stderr from this command is "/usr/sbin/lpadmin: can't access file "/tmp/lp/interface/nirdotprn"".

The script file is existing , I tried changing the owner and group to lp. Still the same problem.

Can any body help me.

Regards,
baiju.
Live and let live.
12 REPLIES 12
Steve Steel
Honored Contributor

Re: moving printers from one server to other.

Hi

Give rwx to everybody on the /tmp/lp you copied to the new machine

chmod -R 777 /tmp/lp

Try again

Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
blal
Frequent Advisor

Re: moving printers from one server to other.

Hi Steve,

I tried by giving full permission , still problem persists.

Thanx
baiju.
Live and let live.
Geoff Wild
Honored Contributor

Re: moving printers from one server to other.

Not too sure if this helps, but this is how I do it:

echo Backing up the spooler configuration to /var/sam/lp/lp.new....please wait...; /usr/sam/lbin/lpmgr -S -v -xsavedir=/var/sam/lp/ ; cp -r -p /var/sam/lp/lp.new/* /var/sam/lp/


Tar up the lp.new dir, ftp that to the other node, untar it,
cp -r -p /var/sam/lp/lp.new/* /var/sam/lp/



echo Restoring the spooler configuration....please wait...; /usr/sam/lbin/lpmgr -R -xsavedir=/var/sam/lp/


The reason I do the cp is because /var/sam/lp is a mounted filesystem (and you can't rm it)as my spooler is in a MC/SG package...

Instead of /tmp, what happens when you use the default of /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.
Geoff Wild
Honored Contributor

Re: moving printers from one server to other.

Okay - I get the same with some of my printers - the ones that are setup as "remote"....except for me the files are not in /var/sam/lp/sinterface - don't know why it looks in there - as there is nothing in my /etc/lp/sinterface dir anyways....

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.
Kevin Wright
Honored Contributor

Re: moving printers from one server to other.

If your using Jetdirect, tar up /var/spool/interface, copy the tar ball to your new server, then run transferqueues script.
blal
Frequent Advisor

Re: moving printers from one server to other.

Hi Kevin,

Yes all my printers are remote printers only.
But can u just give some more details.

After coppying the /var/spool/lp/interface to dest server , which is the script u mentioned to run.

pls give me some more details.

Thanks,
baiju.
Live and let live.
Kevin Wright
Honored Contributor
Solution

Re: moving printers from one server to other.

tar up /var/spool/interface to queues.tar. Copy the archive to new server, then run
/opt/hpnpl/bin/transferqueues.

A. Clay Stephenson
Acclaimed Contributor

Re: moving printers from one server to other.

Actually this is rather easy and we don't need no SAM.

1) On the new box, backup the existing configuration, just to be safe.
lpshut
cd /
find ./var/spool/lp ./etc/lp -print | cpio -ocv > /home/me/lpsave.cpio

Using swinstall, install the newest JetDirect software even if your OLD box is running the obsolete JetAdmin.
Do a final lpshut to maked sure spooler is not running.
You will need to have the printer host names defined in /etc/hosts, DNS, and/or NIS/NIS+.

2) On the old box:
lpstat -t
Look for any old jobs that you don't need and cancel them. There is no point is transferring these.

lpshut

cd /
find ./var/spool/lp ./etc/lp -print | cpio -ocv > /tmp/lp.cpio

ftp / rcp or transfer via tape /tmp/lp.cpio to
the new box. Do not simply use cp or rcp to transfer the lp directories. It is extremely important to preserve ownership and setuid bits. The abobe 'cpio' method will assure that.

On the new box:
cd /
cpio -icvdum < /tmp/lp.cpio

Next (if converting from JetAdmin to JetDirect)
transferqueue local and when prompted answer "all".

lpsched

At this point, everything including the default printer setting will be "good to go".
If it ain't broke, I can fix that.
blal
Frequent Advisor

Re: moving printers from one server to other.

Hi Kevin,

Thanks 'trasferqueue' has worked fine,
it had included all the printers in the queue , but it had all entries in the
/var/spool/lp/interface/ directory are zero byte files.


Do I need to untar the queues.tar in var/spool/lp/interface.
or do I need to restore /var/spool of original server.

pls suggest.

thanks,
baiju
Live and let live.
Geoff Wild
Honored Contributor

Re: moving printers from one server to other.

Looks like instead of manually creating tarball, do this on local server:

transferqueue backup

Then ftp/rcp the /tmp/queues.tar file to /tmp of the destination server.
Then run on the destination server:

transferqueue


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.
Geoff Wild
Honored Contributor

Re: moving printers from one server to other.

The transferqueue does NOT handle remote printers...it is only for jet direct attached...

I placed a call with HP - still open....

For remote printers via: /usr/sam/lbin/lpmgr -S -v -xsavedir=/var/sam/lp/

ON the destination host where you are doing the restore from, the only solution so far is to:


touch /var/sam/lp/sinterface/
touch /var/sam/lp/cinterface/

Then run your restore:

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




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.
derek b smith_1
Regular Advisor

Re: moving printers from one server to other.

Was there a final solution to this?

thanks, derek