?
Solved

Transfer directories and files safely by using the "tar" command.

Posted on 2005-03-08
14
Medium Priority
?
349 Views
Last Modified: 2013-12-27
Hi,

I am in the process of transferring directories and files from a old Sun server to a new Sun Server and decommision the old server.  In general, the new Sun server will be identical in configuration to the old Sun server.  How do I transfer all of the directories and files safely to the new Sun server by using the "tar" command?  What configuration do I need to edit on the new server so that the transition will go smoothly?

Thank you very much for your help.
0
Comment
Question by:gsalcedo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 2
  • +2
14 Comments
 
LVL 34

Expert Comment

by:PsiCop
ID: 13487843
Take a look at this PAQ and see if this doesn't contain some useful ideas (mebbe not the one I adopted, but some of the others suggested) -->http://www.experts-exchange.com/Operating_Systems/Solaris/Q_21003342.html
0
 

Author Comment

by:gsalcedo
ID: 13488456
Hi PsiCop,

Thank you for the link to the similar task.  In the process of transferring users' home directories by using the tar command, I would receive an error message "tar: tarfile must be specified with 'f' function modifier."  Here is the command that I used ..

  tar cf- /export | ssh <target servername> "tar xvf -"

The users' profiles are located under the /export/home directory on the <source server>.

Please point out what I did wrong.  Currently, the <source server> is being used .  If I were to use the "tar" command, would that transfer the directories and files over to the <target server> and remove those tarred directory and files from the <source server>?  If it does, what can I do to eliminate any distraction while the <source server> is still being used?

Thank you.
0
 
LVL 48

Accepted Solution

by:
Tintin earned 750 total points
ID: 13490657
You are missing a space between the 'f' and the '-'

Should be

tar cf - /export | ssh <target servername> "tar xvf -"

tar won't remove any directories on the target server.  Either remove everything from /export on the target server and then do the tar transfer, or if you will be doing this regularly, use rsync, as that will keep directories in sync (by adding/removing files/dirs).

See http://rsync.samba.org/

You can download rsync from http://sunfreeware.com/
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:gsalcedo
ID: 13491149
Hi,

The "tar" command worked great.  Does anyone know the configuration files that I need to transfer over to have the <target server> look identical to the <source server>?

Thank you
0
 
LVL 10

Expert Comment

by:Nukfror
ID: 13491232
You kinda need to be careful here.

What kinda box are you moving off of and what is the box you are moving to ?
0
 
LVL 48

Expert Comment

by:Tintin
ID: 13491260
Depends on your definition of "identical".  You obviously don't want to transfer device files and suchlike over.  Are you mostly interested in stuff like user accounts and network configuration?

Taking over /etc will get most of the stuff, but it all depends on how specific you want to be and what applications you have running.
0
 

Author Comment

by:gsalcedo
ID: 13491524
The only specifics that I want to transfer is the identity of the <source server>, such as the IP address and hostname.  I do not want to transfer any physical description, such as the disk partition.
0
 
LVL 48

Expert Comment

by:Tintin
ID: 13492001
If that's all you want, then just copy:

/etc/inet/hosts
/etc/inet/netmasks
/etc/hostname.*
0
 
LVL 38

Expert Comment

by:yuzh
ID: 13492110
If you just want to change "move" the old server to the new one, and they are not the same
model of Sun box, have a look at my answer in: http:Q_20537122.html

PS: the new server will use the old server name and IP in this case. I wrote that procedure
      a few years ago, and have done it a few times, works for me.

0
 

Author Comment

by:gsalcedo
ID: 13496991
Hi,

Tintin ...  I have transferred those files over, but I would would get errors after rebooting the <replacement server> while the <source server> is turned off.  The error message that I would get is "configuring IPV4 ifconfig: <old hostname> : bad address hme0."  The IPV6 configuring is fine and it refers to it with the <new hostname>.  When the system completely boots up and after I log in, I notice that it sees itself as <new hostname>.  The network configuration did not setup because of the IPV4 issue.  Do you happen to have an idea on what the issue is and how I can resolve it to have the server up and running?

yuzh...  Thank you for your advise.  Since I do not have a tape drive available to physically connect to any of the servers, I am not able to run the "dump" command.  That is the reason why I went with the "tar" path.

Thank you.
0
 
LVL 10

Expert Comment

by:Nukfror
ID: 13497876
gsalcedo - what kinda box are you moving off of and what kinda are you moving to ?
0
 
LVL 48

Expert Comment

by:Tintin
ID: 13502134
You probably have different network adapters.

At a guess, I would say the new server has eri0 instead of hme0, in which case just rename /etc/hostname.hme0 to /etc/hostname.eri0
0
 
LVL 38

Expert Comment

by:yuzh
ID: 13502214
That's why you should read the LINK in my comment  http:Q_20537122.html, now you need
to use the procedure to fix it up

at least you need to:

mv
hostname.hme0 hostname.interfacename

You might have to worry about the Graphic card as well.
0
 

Author Comment

by:gsalcedo
ID: 13519290
Hi,

I actually had to change the hostname in the hostname.hme0 file.  After that, it worked.  Although the transfer of files went well, I am encountering an issue with a daemon that is supposed to work on the current server (<replacement server>).  On the old server (<source server>) there is a daemon called "tcpd" that is supposed to work when updating the IPs on the Cisco router.  On the <source server> I noticed that the "tcpd" is located in the /usr/local/bin directory, according to the inetd.conf file.  On the <replacement server>, the "tcpd" file is located in the /usr/local/etc directory.  Does anyone know about the procedure that I need to take to setup the "tftpboot"(tcpd) to work properly?

Thank you
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Suggested Courses
Course of the Month8 days, 18 hours left to enroll

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question