HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (
-   Server Operation (
-   -   restoring website from one server to another (

happz 26th March 2011 10: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 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?


ChadNomad 26th March 2011 14: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;


chown -R web1 /the/path/*
chgrp -R <groupname> /the/path/*

happz 26th March 2011 18: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?


falko 27th March 2011 21: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 05: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 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?


falko 28th March 2011 15:22

You can make a .tar.gz of the web site like this:

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...

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:

tar xvfz backup.tar.gz

happz 29th March 2011 05:56

Awesome! Thanks!

happz 25th December 2012 05: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:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@
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.


falko 28th December 2012 12:51

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

All times are GMT +2. The time now is 05:44.

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