HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   General (http://www.howtoforge.com/forums/forumdisplay.php?f=15)
-   -   how to move /var/www/ directory to another hard drive? (http://www.howtoforge.com/forums/showthread.php?t=25431)

malinens 24th July 2008 17:23

how to move /var/www/ directory to another hard drive?
 
I have Ubuntu 7.10 server. I have mounted one hard disk to /var/www but this disk is almost full and I bought a new one. What should I do to safely copy files from old hard disk to new disk? New hard disk is at home but server is in data center. Can anyone give my step by step instructions to not to loose my data?

/Sorry for my crappy English/

Hans 24th July 2008 17:44

If your new drive is mounted to your Linux pc or other server, you can do the following:

1) Login to your server via SSH with Putty.
2) Go to the directory /var/www:
cd /var/www

3) Copy the content whole content to your other pc/server containing the new drive by using the secure copy command:
scp * -r <IP-address>:/var/www/

Note: <IP-address> is the External IP-address of your destination.
Forward this external IP-address for port 22 (SSH) to the internal IP-address of your machine containing the new drive.

awd.pt 26th July 2008 01:11

Hi,

I would tar the directory to somewhere with enouth space and the scp to my home server/disk and untar.

This way you would not loose the permissions/ownerships of the files/directories.

Assuming free space at ~root
tar pzcf ~root/www.tgz /var/www
scp ~root/www.tgz <myhomeuser>@<myhomeip>:
exit
cd <myhmeservernewdisk>
tar zxf ~<myhomeuser>/www.tgz

This way you'll only need, after, to unmount the disk and take it to the data centre.

Good luck.
SÚrgio Rosa


All times are GMT +2. The time now is 00:07.

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