[Server Migration] Server to Server File Transfer

iisbetoq

New member
Joined
Jul 29, 2013
Messages
36
Points
0
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

New member
Joined
Jul 29, 2013
Messages
36
Points
0
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
4,857
Replies
1
Views
3,602
Ric
Replies
24
Views
17,896
Newer threads
Replies
11
Views
6,403
Replies
16
Views
6,410
Replies
25
Views
24,289
Replies
4
Views
2,820
Latest threads
Replies
0
Views
9
Replies
2
Views
14
Replies
0
Views
11
Replies
4
Views
20
Replies
4
Views
20

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