move large site on cpanel server

Jump to: navigation, search

This is how we move large site from one cpanel server to another.

On Source

Find Big folder using

cd /home/cpaneluser/public_html
du -h --max-depth=1

Then move large folders with rsync to new server

ON new server

Create a temporary folder

cd /home

Now check if a temp folder already exists

ls -l /home | grep hon_move

If the folder already exists, there should be old files, you should remove them

cd /home
rm -rf hon_move

Now create an empty folder

mkdir hon_move

Now you login to OLD server and copy files to this folder.

Copy Files from OLD to NEW server

rsync -a -v  --progress --timeout=0 -e "ssh -p 3333" /home/cpaneluser/public_html/flvideo [email protected]:/home/hon_move/
rsync -a -v  --progress --timeout=0 -e "ssh -p 3333" /home/cpaneluser/public_html/video [email protected]:/home/hon_move/

After the folders and files are copied to NEW server, move the large files out of the site folder, so you can move the site easily with WHM transfer feature.

Before you do this, make sure there is no folder /home/move_src

ls -l /home | grep move_src

If a folder exists, it can be your old site move, you should remove them or files will get mixed up.

cd /home/cpaneluser/public_html
rm -rf /home/move_src
mkdir /home/move_src
mv flvideo /home/move_src/
mv video /home/move_src/

Moving Site With WHM

Now Login to WHM of NEW server and transfer the site from OLD server.

This will be done faster as we are not copying the large folders, thease we already copied with rsync.

On new server, move the files to its original location.

cd /home/hon_move
mv flvideo /home/cpaneluser/public_html/
mv video /home/cpaneluser/public_html/

Set proper permissions or it can create problem as we rsync the files as user root.

cd /home/cpaneluser/public_html/
chown -R cpaneluser:cpaneluser flvideo
chown -R cpaneluser:cpaneluser video
chmod -R 777 flvideo
chmod -R 777 video

Edit DNS On old Server

Login to WHM on OLD server, edit DNS and point to the domain to new server.

On Old server, files are moved out of site folder, so for any visitor who have old ip cached, will see site from old server will cause problem as files are missing. So we will move the files back to its original location.

cd /home/move_src/
mv flvideo /home/cpaneluser/public_html/
mv video /home/cpaneluser/public_html

Wait 24 hours, you can delete the site from OLD server keeping the DNS entry (or you need to change name servers of the domain to new server).