Solved

Transfer Files from one LAMP Machine to Another

Posted on 2014-12-18
10
187 Views
Last Modified: 2014-12-20
I have two LAMP server and I need to transfer a whole directory structure from Machine A to Machine B.

I have telnet root access to both machines.

For most projects I'm working on I just use FTP and download files to my local drive and then upload to the new server via FTP.

But this particular application has nearly 25GB of files to transfer and I would like to simply go straight from server to server.

Is there a simple way to do that from from within the shell access?
0
Comment
Question by:pkonstan1
[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
  • 3
  • 3
  • 2
  • +2
10 Comments
 
LVL 12

Assisted Solution

by:Kent W
Kent W earned 150 total points
ID: 40507849
You most likely have ssh, not telnet access.  

If you are transferring files, I would recommend rsync.  It pipes through ssh nicely, so all you need to do is something like

rsync -avz -e ssh /var/www/html/ server.domain.com:/var/www/html/

For this example, I'm assuming you want to transfer /var/www/html/ to the new machine.
-e ssh tells rsync to pipe through ssh (what you are probably referring to as "telnet").

All you need to do upon running the command is give the root pass / user when prompted.
"server.domain.com" is your receiving server.

Do NOT try to transfer / (your whole directory structure). Just transfer the files / config files you actually need to migrate.  If you transfer things like /dev /proc, etc. you will hose the receiving box.
0
 
LVL 58

Accepted Solution

by:
Gary earned 200 total points
ID: 40507872
You could always just tar the files, put them in a public directory and wget the file on the other server.
0
 

Author Comment

by:pkonstan1
ID: 40507904
I just realized that I don't have root SSH access on the receiving machine, so I'll have to do the tar option.

Can you give me a sample of how those commands would work?

I'm only moving over a bunch of audio files. It could be as much as 25GB and 1000 files. Will that work via TAR?
0
Is Your DevOps Pipeline Leaking?

Is your CI/CD pipeline a hodge-podge of randomly connected tools? You’ve likely got a tool to fix one problem & then a different tool to fix another, resulting in a cluster of tools with overlapping functionality. Learn how to optimize your pipeline with Gartner's recommendations

 
LVL 58

Expert Comment

by:Gary
ID: 40507920
Depending the server setup you may be able to do a server to server transfer in your FTP program

tar just packs the files into one file that you can then untar when transferred - easier than copying each file individually.

tar -zcvf target_name.tar.gz folder_to_tar
0
 
LVL 40

Assisted Solution

by:omarfarid
omarfarid earned 75 total points
ID: 40507937
is ftp open between the two servers?

you can always schedule crontab job to tar the files and then transfer to the other server via ftp and on the remote server untar files.

if you could have ssh between the two systems allowed then you could schedule scp via crontab to copy folders between the two.
0
 
LVL 12

Expert Comment

by:Kent W
ID: 40508018
Also, if you have a web server running on the first machine, you can place the .tar in a web directory and use wget from the new machine to download.

wget http://first.machine.com/directory/file.tar.gz

It will be downloaded to the directory from which you issue the command.
0
 
LVL 58

Expert Comment

by:Gary
ID: 40508032
You just repeated exactly what I said.
0
 
LVL 12

Expert Comment

by:Kent W
ID: 40508043
Oops.  Didn't see that Gary, my apologies.

Oh, I see, I saw his request for how go use wget.  That's more of the lines of what I was answering.  The actual command, which OP asked.  I think after that was where you addressed the ftp how-to, and actual unzipping.
0
 
LVL 38

Assisted Solution

by:Gerwin Jansen, EE MVE
Gerwin Jansen, EE MVE earned 75 total points
ID: 40510785
You would not need root access for copying files from one system to another, just a user that can logon (ssh) that has write access to the destination folder.

You can use tar on one server to create the archive directly to stdout, then send that to tar on the other machine to write output to the destination.

Like this:

(on source system)

tar cfz - /source/path | ssh user@destinationhost tar xfz - -C /destination

Open in new window


In the example above path is your source folder with the audio files, the command above will create that same folder as a subfolder of /destination. z option is compressing data as it is being transferred.
0
 

Author Closing Comment

by:pkonstan1
ID: 40511329
Good answer. Hard to pick any one as best since they all add to it.  Thanks.
0

Featured Post

Is Your DevOps Pipeline Leaking?

Is your CI/CD pipeline a hodge-podge of randomly connected tools? You’ve likely got a tool to fix one problem & then a different tool to fix another, resulting in a cluster of tools with overlapping functionality. Learn how to optimize your pipeline with Gartner's recommendations

Question has a verified solution.

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

Suggested Solutions

If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
Outsource Your Fax Infrastructure to the Cloud (And come out looking like an IT Hero!) Relative to the many demands on today’s IT teams, spending capital, time and resources to maintain physical fax servers and infrastructure is not a high priority.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

734 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