Operating System - HP-UX
1834586 Members
3736 Online
110069 Solutions
New Discussion

Re: Best way to copy the whole system to another host

 
nash11
Frequent Advisor

Best way to copy the whole system to another host

I have two unix server , I want to copy all the data from one server include its file permission , directory , owner , time stamp , symbolic link ( anything except the OS ) to another host , so that both hosts has exactly the same data , what is the best command in unix? thx
5 REPLIES 5
A. Clay Stephenson
Acclaimed Contributor

Re: Best way to copy the whole system to another host

If this is HP-UX to HP-UX then the least evil free choise is fbackup/frecover. You could also use tar or cpio but you should be aware that tar (if patched) has a maximum file size limit of 8GiB and cpio has a maximum of 2GiB; fbackup/frecover does does have this limitation so a pipeline of fbackup using remsh to frecover will send it over the network. Skip the remsh and use tape; it's your call.

Now, since you have to ask I am going to suggest that perhaps you are not the best choice because what you are asking is a bit dangerous if you are unfamiliar with HP-UX and you could easily wind up with an impossible to patch (safely) system.
If it ain't broke, I can fix that.
Victor Fridyev
Honored Contributor

Re: Best way to copy the whole system to another host

Hi,

I agree with the previous (A.C.S) message, but I hope that you are enough careful in order not to destroy the target computer. I suggest, you don't intend to copy /usr, /opt and /var, but only /home
Technically what you want to do is not very complicated. For this purpose I use tar and permit remsh access, at least for period of copying.

On the source:
cd /home| tar cf - dirname1 dirname2 ...|
remsh target "cd /home; tar xf -"
If you copy homedirs, you will have to update /etc/passwd and /etc/group on the target machine accordingly.
If you want to copy databases, ensure that database server installation is copied normally, shut down databases and only after copy their files.

HTH

Entities are not to be multiplied beyond necessity - RTFM
Khashru
Valued Contributor

Re: Best way to copy the whole system to another host

Also make sure that in both the system users and groups has the same UID and GID. Otherwise permission will be changes as UNIX remember permission by ID naot name.
yulianto piyut
Valued Contributor

Re: Best way to copy the whole system to another host

hi nash,

try to user rsync. just googling to download rsync software. example using rsync:

# rsync -arvuzP source_dir destination_dir


-yut-
Steven E. Protter
Exalted Contributor

Re: Best way to copy the whole system to another host

Shalom,

fbackup is indeed the best choice.

You can go filesystem by filesystem with:

rcp -rp /fs/ hostname:/fs

or

ssh -rp /fs/ hostname:/fs

rsync with ssh to preserve some level of security is probably the best choice after fbackup.

rsync example:
rsync -avH --stats --delete -e ssh /var/httpd/ $othernode:/var/httpd/
# this syncs a webserver httpd filesystem from one system to another (part of a cluster configuration).

No matter what, make sure all databases and applications are down when you do this.

SEP

Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com