Selling Site Transfer Script - Please Read(Hard to explain)

Discussion in 'Programming' started by cPAce, Apr 13, 2012.

  1. #1
    Greetings fellow DP members,

    I am in need of a script that is a bit different then expected.

    I basically have a 2 servers. One server has the main site on it and the second server has the dev site on it. I need a script that will basically sync the dev site to be up to date with whats happening on the main site with a click of a button.

    I need this script to be a site based script with a login to keep it secure.

    Pretty basic, im just not sure how to actually do it.
     
    cPAce, Apr 13, 2012 IP
  2. st1905

    st1905 Well-Known Member

    Messages:
    573
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    135
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #2
    Does your site use a database ? If its not using a database, the sync script can be written within php and can use rsync. Do you have ssh access on both servers ? If its using a database, does it need to be identical with the live database ? (I mean the dev site).
     
    Last edited: Apr 13, 2012
    st1905, Apr 13, 2012 IP
  3. KangBroke

    KangBroke Notable Member

    Messages:
    1,026
    Likes Received:
    59
    Best Answers:
    4
    Trophy Points:
    265
    As Seller:
    100% - 6
    As Buyer:
    100% - 7
    #3
    Linux or windows


     
    KangBroke, Apr 13, 2012 IP
  4. KangBroke

    KangBroke Notable Member

    Messages:
    1,026
    Likes Received:
    59
    Best Answers:
    4
    Trophy Points:
    265
    As Seller:
    100% - 6
    As Buyer:
    100% - 7
    #4
    This should help you out.

    Thumbs up if I helped you out

    http://www.howtomonster.com/2007/08/08/how-to-sync-data-between-2-servers-automatically/



     
    KangBroke, Apr 13, 2012 IP
  5. cPAce

    cPAce Peon

    Messages:
    445
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #5
    Its for a Linux box. Both ends have cPanel. I am a Linux Admin myself, but the script will be used by a web dev only. The site that needs to be synced is a Magento Cart website. I just need something easy for this web dev to use and thats all.
     
    cPAce, Apr 13, 2012 IP
  6. st1905

    st1905 Well-Known Member

    Messages:
    573
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    135
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #6
    Then its pretty easy, i assume the dev site does not need the identical database from the live magento site so its just to create passwordless ssh between the two servers, lets say the user is magento and this user will have passwordless ssh to the dev server and have rights to execute rsync via sudo...

    Then using exec function within php you can create a little php file and setup a cron to sync it whenever you want...

    @KangBroke sent you the exactly the same method and it works well enough...
     
    st1905, Apr 13, 2012 IP
  7. cPAce

    cPAce Peon

    Messages:
    445
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #7
    The thing is, it will need to have identical everything. The dev server is simply to test the new site fixes before being pushed to the main server, no work is actually done on the dev server. So it will need to sync everything in /public_html/ and the database itself. I just need a script, that is all. I know I can do all of this via ssh and what not but I need it to be stupid proof for the web dev to be able to work on.
     
    cPAce, Apr 13, 2012 IP
  8. st1905

    st1905 Well-Known Member

    Messages:
    573
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    135
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #8
    The thing we told you involves ssh while you set it up afterwards its just simple as calling a php file from browser, to sync the database, you can just create master/slave replication or (Little weird but it`ll work), rsync the database directly from the /var/lib/mysql/databasename to the dev server, within the same php file where you sync the files.

    So one file, syncs both database and files.
     
    st1905, Apr 13, 2012 IP
  9. cPAce

    cPAce Peon

    Messages:
    445
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #9
    Ok, let me put it like this, I don't want to deal with this haha. My job is to make sure all servers are up and running at all times, not to setup things like this. Who wants to do this for me? Let me know how much.
     
    cPAce, Apr 13, 2012 IP
  10. KangBroke

    KangBroke Notable Member

    Messages:
    1,026
    Likes Received:
    59
    Best Answers:
    4
    Trophy Points:
    265
    As Seller:
    100% - 6
    As Buyer:
    100% - 7
    #10
    $15 paypal
     
    KangBroke, Apr 13, 2012 IP
  11. cPAce

    cPAce Peon

    Messages:
    445
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #11
    Deal. PM me your skype name.
     
    cPAce, Apr 13, 2012 IP