HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Server Operation (http://www.howtoforge.com/forums/forumdisplay.php?f=5)
-   -   restoring website from one server to another (http://www.howtoforge.com/forums/showthread.php?t=52039)

happz 26th March 2011 09:53

restoring website from one server to another
 
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

ChadNomad 26th March 2011 13:09

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/*


happz 26th March 2011 17:11

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

falko 27th March 2011 20:12

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.

happz 28th March 2011 04:00

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

falko 28th March 2011 14:22

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

happz 29th March 2011 04:56

Awesome! Thanks!

happz 25th December 2012 04:49

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 root@xx.xx.xx.xx(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

falko 28th December 2012 11:51

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


All times are GMT +2. The time now is 12:52.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.