restoring website from one server to another

Discussion in 'Server Operation' started by happz, Mar 26, 2011.

  1. happz

    happz Member

    This is a first time for me on restoring a website to another server-

    I back up my website's using the backup feature on ispconfig3. I decided to take the old server down and bring a new one up.

    I copied the web.1.zip file to my pc and then logged into winscp as root and copied the zip file over. I then logged into putty and unzipped.

    After I found most all my files being owned by root when before it was web1 as owner.

    Where am I going wrong?

    happz
     
  2. ChadNomad

    ChadNomad New Member

    I think that you are probably logged in as root which is why the files are given that permissions.

    You use the commands chown (change owner) and chgrp (change group) to change the user and group.

    example of recursive is something like;

    Code:
    chown -R web1 /the/path/*
    chgrp -R <groupname> /the/path/*
     
  3. happz

    happz Member

    Thanks. Is there a specific how to you know of? Like in steps on how to add back the zipped folder to another location?

    Thanks,
    happz
     
  4. falko

    falko Super Moderator Howtoforge Staff

    Unzip the file on your PC and then upload them to the web site with FTP (make sure you use the correct FTP user). That way the files are automatically owned by the FTP user.
     
  5. happz

    happz Member

    Let me ask you this question.

    What i have is- srv1 running wwwdotgodaddydotcom and it is web.4zip

    So I decided to shut down srv1 because it is getting old and I just bought a new server (srv2)

    On srv2 I decided to not add back all of my website and only one website wwwdoegodaddydotcom but now it is my first and only website on srv2 which also has a different ftp user as well.

    How can I download web.4.zip from srv1 and then unzip it and upload to the new server when it is a different ftp server now? Plus, the website has many permissions set i.e. /application/public which is all 777 yet, /application/non-public is 755 and in other places I have file rights set throughout. How in this situation can I get permissions back down to the original file rights and with the same ftp user?

    happz
     
  6. falko

    falko Super Moderator Howtoforge Staff

    You can make a .tar.gz of the web site like this:
    Code:
    tar -pczf backup.tar.gz /path/to/web/site
    This will keep all permissions and ownerships. You can then transfer the .tar.gz to the new server with scp...
    Code:
    scp backup.tar.gz root@srv2:/path/to/directory
    (replace srv2 with the full hostname or IP of server2)

    ... and there you can uncompress it like this:
    Code:
    tar xvfz backup.tar.gz
     
  7. happz

    happz Member

    Awesome! Thanks!
     
  8. happz

    happz Member

    back to doing this again...

    I followed the instructions by falko and was able to move a website from one server to another but that was a while back. I think things have changed so I was wanting to know if there is something else I can do?

    When I ran:
    scp tf2home.tar.gz [email protected](my public IP):/var/www/clients/client1/web3

    and I get:

    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
    Someone could be eavesdropping on you right now (man-in-the-middle attack)!
    It is also possible that the RSA host key has just been changed.
    The fingerprint for the RSA key sent by the remote host is
    ....


    Any advice would be appreciated.

    Thx,
    happz
     
  9. falko

    falko Super Moderator Howtoforge Staff

    Remove the identification string of that server from ~/.ssh/known_hosts and try again.
     

Share This Page