XFileSharing Pro - faster way to transfer files from server?

Posts: 135
Joined: May 05, 2011 4:47 pm

faster way to transfer files from server?

#1 Postby RockDiz » Nov 03, 2012 5:49 pm

Well I'm planning on replacing one of my file servers and I have over 100k files to transfer to a new file server. I'm manually doing it in increments of 200, I was wondering if it would hurt to increase the number of files I transfer at a time and if there's some script that I could use that'll automatically do the transfer for me?

Posts: 149
Joined: Dec 21, 2009 9:24 am

#2 Postby trinsic » Nov 04, 2012 7:56 am

You can use SCP or RSync in SSH. The directories inside the upload folder can be copied directly from one server to another then all that is required is an update of the srv_id for each file in MySQL.

Run this on the new server, I'd copy to a temp directory first so you can fix user/group permissions if they need it:

Code: Select all

rsync -av -e ssh [email protected]:/home/old_home/ /home/new_home/

Change username, oldserverhost and the directory paths to suite.

Then in MySQL run:

Code: Select all

UPDATE Files SET srv_id=2 WHERE srv_id=1

This changes the server ID from 1 to 2, again change to suite your situation.

Once you think it's working you may remove the files from the old file server.

Return to “XFileSharing Pro”