How to move files between servers?

In this article am going to talk about how to move or copy files between the servers. When you decided to migrate from your current hosting provider or if you got a new server or some time from your development environment to you might need to move/copy you data to new server.

Copy/transfer files from one server to another

Usually it’s a painful process of downloading all these data and uploading to new host again. By using PHP ftp functions you can easy copy/move your data from one server to another.

//Include the FTP class - I have used Codeigniter FTP Class
require_once('Ftp.php');

$ftp = new CI_FTP();

//Host of the old server where you have backup data	
$config['hostname'] = 'IP Address goes here';

//FTP username
$config['username'] = 'Username';

//FTP Password
$config['password'] = 'password';
//Debug - If required
$config['debug'] = TRUE;

//COnnect FTP
$ftp->connect($config);

//You can upload the file using below line of code
// $ftp->upload(LOCAL PATCH, REMOTE PATH);
$ftp->download('filename.zip', '/public_html/filename.zip');

//Close FTP
$ftp->close();

10 Comments How to move files between servers?

  1. hack twitter

    Wrathful info. Favored mе I discovered yօur web site unintentionally, аnd аm dismayed ѡhy this chance event diԀ non came aЬout earlіer! I bookmarked іt.

    Reply
  2. Chara Marian

    Spot on with this write-up, I seriously think this amazing site needs a great deal more attention. I’ll probably be back again to see more, thanks for the advice!

    Reply
  3. Anonymous

    I’m not that much of a online reader to be honest but your blogs really nice, keep it up! I’ll go ahead and bookmark your website to come back down the road. All the best.

    Reply
  4. Anonymous

    Excellent website. A lot of useful info here. I’m sending it to several pals ans also sharing in delicious. And of course, thanks to your effort!

    Reply
  5. Anonymous

    Whoah this weblog is magnificent i like studying your posts.
    Stay up the good work! You recognize, many individuals are hunting around for this information, you could aid them greatly.

    Reply
  6. Anonymous

    Hello! Do you use Twitter? I’d like to follow you if that would be ok. I’m undoubtedly enjoying your blog and look forward to new updates.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>