Easy way to move a MySQL DB between hosts?

Status
Not open for further replies.

Jondoe0069

New member
Mar 21, 2007
1,317
19
0
Estados Unidos
My host fucked me and I signed up for a new one. I need to move all my sites, including the data bases to the new host. What is the best way to move the DB's? Should I just back them up and then restore them to the new host?
 


Cpanel on the old site, GoDaddy's gay interface on the new site.

I usually won't use anything that doesn't have cpanel, but GoDaddy is the only host with reasonable month to month and this is just some temporary side stuff that I don't want on my main hosting account. The old host I had them on is MidPhase and they are shitty.
 
If you're using phpMyAdmin export it as SQL without compression, which is usually selected by default, and it'll bring you to a page with a text area with the code in it. Copy and paste that into a text file.

Then on your other server, open up whatever database management software GoDaddy uses. Find a query button, it should bring you to a page with a text area - then just copy and paste the code from your text file.

It'll automatically re-create your table structure and insert all of your data.
 
The phpMyAdmin method works very well.

Alternatively, if you have shell access, On your current server ... Run the SSH command ..

mysqldump -uUSERNAME -pPASSWORD DATABASE > dump.txt

Upload it to the new server and run

mysqldump -u<username> -p<password> <database name> < dump.txt


That should have you set on the new server ...

If the database is pretty big, you might want to consider using bigdump.
BigDump: The Staggered MySQL Dump Importer

Anarkist
 
Status
Not open for further replies.