[Server Migration] Server to Server File Transfer

iisbetoq

Member
Joined
Jul 29, 2013
Messages
36
Points
8
I hope this thread not repost :)

Examples Case :
I have wordpress blog at hosting A, and i want move to hosting B, so i backup wp-content and sql database. If my wp-content backup size 1GB, i must download it and reupload to hosting B that waste my time, so i use this script code, example this file name is download.php :
PHP:
<?php
$saveTo = 'wp-content.zip';// file name
$downloadFrom = 'http://mydomainname.com/wp-content.zip';// Source file

$curl = curl_init();
$fp = fopen($saveTo, 'w');
curl_setopt($curl, CURLOPT_URL, $downloadFrom);
curl_setopt($curl, CURLOPT_FILE, $fp);
curl_setopt($curl, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
curl_exec ($curl);
curl_close ($curl);
fclose($fp);
echo 'Transfer Done';
?>
put download.php to your live domain then access it ex : http://yourdomainname.com/download.php
thats it, yes just thats it :)

FYI, this code i got from my friend, but if you have a question feel free to asking here :)

Best Regards
IisBetoQ
 

Anthony M. Dyer

New member
Joined
Aug 1, 2013
Messages
72
Points
0
Thansk for sharing this information,but in which file I have to add this code?
 
Last edited:

iisbetoq

Member
Joined
Jul 29, 2013
Messages
36
Points
8
iisbetoq
you must make one file, example case download.php and put on your live domain, and run it
yourdomainname.com/download.php
 

Mathew

New member
Joined
Aug 6, 2013
Messages
24
Points
0
Mathew
Can we use a load balancer for server migration? I heard from my friend it is the best solution to transfer file from one server to another to minimize the extra load on main server.
 
Older threads
Replies
0
Views
5,688
Replies
1
Views
4,640
Ric
Replies
24
Views
19,902
Newer threads
Replies
11
Views
7,245
Replies
16
Views
7,593
Replies
25
Views
26,871
Replies
4
Views
3,464
Latest threads
Replies
1
Views
43
Replies
0
Views
54
Replies
0
Views
48
Replies
1
Views
58
Replies
3
Views
129
Recommended threads

Latest postsNew threads

Referral contests

Referral link for :

Sponsors

Popular tags

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top