Tag Archive | migrate Cpanel to cPanel

How to migrate a Addon domain in cPanel


On the old server

#cd /home/usename/public_html/

#du -sch Addon domain
XXMB

home/usename/public_html # tar -cvzf Addon domain.tar.gz Addon domain
home/usename/public_html # cp Addon domain.tar.gz /usr/local/apache/htdocs
home/usename/public_html # cd /usr/local/apache/htdocs
usr/local/apache/htdocs # chmod 644 Addon domain.tar.gz
usr/local/apache/htdocs # hostname
server.xxxx.xxx

Now login in to the new server where you have already created the new cpanel account
***Note the new account should have the same user name as the old account

# cd /home/usename/public_html

home/usename/public_html # wget http:server.xxxx.xxx/Addon domain.tar.gz
home/usename/public_html # tar -xvzf Addon domain.tar.gz

Now check if document root set corretly if not you may have to change it

To change the document root this changes need to be done in two files

home/usename/public_htm # vi /var/cpanel/userdata/usename/Addon domain
Change the line where it says documentroot:
home/usename/public_htm # vi /etc/httpd/conf/httpd.conf
find the Addon domain in this file and change the document root
Now All the data is copied on the new server But this not it now you need to migrat the data base and also the mails and the etc folder.
So go back to old server find the Data Base NAME to fine the it Data Base NAME you can check the config.php file
For eg if it is wordpress site you can get that info from wp-config.php

home/usename/public_htm # mysqldump Data Base NAME > Data Base NAME.sql
home/usename/public_htm # cp Data Base NAME.sql /usr/local/apache/htdocs
/usr/local/apache/htdocs # chmod 644 Data Base NAME.sql

Now login in to the new server

home/usename/public_html # wget http:server.xxxx.xxx/Data Base NAME.sql
Now the you have got the Data Base backup on the new server but the data base is not present on the server so you will have to creat the data base

So loging to cPanel and create the Data Base with the same name and also the usename and the password for that

Ones you have created the Data Base

home/usename/public_html # mysql Data Base NAME < Data Base NAME.sql

NOw the database is migrated so onlt mails and etc is left

Go back to old server

home/usename/public_html # cd home/usename/mail
home/usename/mail # tar -cvzf Addon domain.tar.gz Addon domain
home/usename/mail # cp Addon domain.tar.gz /usr/local/apache/htdocs
home/usename/mail # cd /usr/local/apache/htdocs
usr/local/apache/htdocs # chmod 644 Addon domain.tar.gz

Now login in to the new server

home/usename/public_html # wget http:server.xxxx.xxx/Addon domain.tar.gz
home/usename/public_html # cd /mail
home/usename/public_html/mail # mv ../pensiontransferoptions.co.uk .
home/usename/public_html/mail # chown usename:usename * -R

Now the last thing is /etc

Go back to old server

home/usename/public_html # cd home/usename/etc
home/usename/etc # tar -cvzf Addon domain.tar.gz Addon domain
home/usename/mail # cp Addon domain.tar.gz /usr/local/apache/htdocs
home/usename/mail # cd /usr/local/apache/htdocs
usr/local/apache/htdocs # chmod 644 Addon domain.tar.gz

Now login in to the new server

home/usename/public_html # wget http:server.xxxx.xxx/Addon domain.tar.gz
home/usename/public_html # cd /etc
home/usename/public_html/etc # mv ../pensiontransferoptions.co.uk .
home/usename/public_html/etc # chown usename:mail * -R

Now you can logging to the new server cPanel and check