1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Need help ftp'ing site to new host using PHP

Discussion in 'PHP' started by rvarcher, Mar 31, 2006.

  1. #1
    I am moving a web site to a new host. Neither the current nor the new host give shell access to run FTP from the shell.

    I know you could use an FTP client to copy all files to my computer then copy them back to the new host but I'd rather do it directly from one to the other.

    How would one initiate the FTP command from a PHP script? Maybe the EXEC function could be used?

    Things I don't know:

    - How to start something (like FTP'ing files) and have the PHP script quit while the FTP process continues. I don't want the PHP script to time out before all the files are copied.

    - The actual FTP command to copy files to a new host. Like how to include the username, password, etc.

    Thanks,
    SEMrush
     
    rvarcher, Mar 31, 2006 IP
    SEMrush
  2. T0PS3O

    T0PS3O Feel Good PLC

    Messages:
    13,220
    Likes Received:
    778
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Use Beyond Compare to lift it over 1:1. That way you can also verify each file went over correctly.

    Using PHP would be way more effort than a quick Beyond Compare. They offer free trial (no limit) but it's well worth buying.

    Basically an FTP program with two simultaneous connections.
     
    T0PS3O, Mar 31, 2006 IP
    exam likes this.
  3. exam

    exam Peon

    Messages:
    2,434
    Likes Received:
    120
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks for the tip, hadn't seen that program before.
     
    exam, Mar 31, 2006 IP
  4. T0PS3O

    T0PS3O Feel Good PLC

    Messages:
    13,220
    Likes Received:
    778
    Best Answers:
    0
    Trophy Points:
    0
    #4
    It'll be an eye-opener. I'd place it as #1 webmaster tool - just above FireFox web developer toolbar, FileZilla and Zend Studio.
     
    T0PS3O, Mar 31, 2006 IP
  5. rvarcher

    rvarcher Peon

    Messages:
    69
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Thanks for the info. I'll try it soon. It's kind of weird because I saw that program for the first time recently as I upgraded some developer's computers who I support but I had no idea what it was.
     
    rvarcher, Mar 31, 2006 IP
  6. T0PS3O

    T0PS3O Feel Good PLC

    Messages:
    13,220
    Likes Received:
    778
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Yeah I'm quite amazed how little known it is. It really is an essential tool if you have to control site updates etc. Really easy to compare versions and list over those changes you need. Or if your newer version turns out buggy, you caneasily compare line by line to see where you went wrong.
     
    T0PS3O, Apr 1, 2006 IP
  7. rvarcher

    rvarcher Peon

    Messages:
    69
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Worked great. Synched data between 2 ftp connections, no problem. Now if it would only do my databases. :)
     
    rvarcher, Apr 3, 2006 IP
  8. T0PS3O

    T0PS3O Feel Good PLC

    Messages:
    13,220
    Likes Received:
    778
    Best Answers:
    0
    Trophy Points:
    0
    #8
    PHPMyAdmin is your friend for that one. Export - Import. Done. Unless it's a huuuuuge one, then you'll probably end up fiddling with split exports.
     
    T0PS3O, Apr 3, 2006 IP
  9. Weirfire

    Weirfire Language Translation Company

    Messages:
    6,979
    Likes Received:
    365
    Best Answers:
    0
    Trophy Points:
    280
    #9
    I usually use the backup function in cpanel for transferring databases rather than going into phpmyadmin. It saves it as a gzip file and you can then upload as a gzip. Depending on the size of your database it could take a while uploading.
     
    Weirfire, Apr 3, 2006 IP