Migrating very large account to new server

Dave Sawyer

Registered
Sep 25, 2019
2
0
1
UK
cPanel Access Level
Root Administrator
Hi,

We have just taken delivery of a new server with the same hosting company, as the account on our current server has outgrown its needs. The main volume is 500GB and we are using just under 400GB.

I need to move the hosting account to the new server, but realise we do not have enough disk space on the source server to package the account up, so it can be moved. The account includes 7 mysql databases of which the largest is 237GB.

Can anyone point me to a guide as to how I can manually copy the databases over to the new server, without having to generate a mysql dump on the local machine.

Many Thanks

Dave
 

Dave Sawyer

Registered
Sep 25, 2019
2
0
1
UK
cPanel Access Level
Root Administrator
No, that is no good. Firstly not enough disk space on the source server available to create the packages on and also packaging up databases this size is not best practice. Is there a command to just rsync the mysql databases over, without having to create a dump on the source server, as there is not enough space.

I have manually moved the cpanel hosting account fine. It is just the MySQL DB's that I have the problem with.
 

Tiberiu

Member
Oct 18, 2016
5
0
51
Bistrita
cPanel Access Level
Root Administrator
Best way to migrate a database is to make a dump from mysql and imported to the new server but you dont have enough space. You can try to add a new disk and mount it and export the database on that disk. Thats what i will do anyway.

Now, there are other options to: if you have a db that has only Myisam tables you can recreate it to the new server and just sync the content from /var/lib/,mysql/database from the old server.
If you have Innodb tables you cand sync the database and ibdata on the new server, i've done this but not with such a big database.

Good luck.
 

Jcats

Well-Known Member
PartnerNOC
May 25, 2011
807
160
168
New Jersey
cPanel Access Level
DataCenter Provider
You can use mysqldump and import it remotely so it will not consume any space on the local server, example:

On the source server you would run:

Code:
# mysqldump dbname| mysql -u someuser -p -hremoteserver.com dbname
Just make sure you whitelist the source and remote server IP's on each server.

You also have to add a user on the remote server to allow the source server, example..

On the remote server:

Code:
# mysql -e "grant all privileges on dbname.* to 'someuser'@'123.123.123.123' identified by 'somepassword';"
# mysql -e "grant all privileges on dbname.* to 'someuser'@'sourceserverhostname' identified by 'somepassword';"
# mysql -e "flush privileges;"
So do this step first along with whitelisting IP's as MySQL port 3306 is most likely closed in the firewall.

Then run your mysqldump command on the source server.

Hope this helps!

Also to add, you can use the WHM > Transfer Tool but exclude the databases, and then import them using the above.
 
  • Like
Reactions: cPanelLauren

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,301
363
Houston