Copy a MySql Database

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
hansteam
Forum Newbie
Posts: 11
Joined: Tue Aug 02, 2005 2:52 pm
Location: Minnesota

Copy a MySql Database

Post by hansteam »

I have a MySQL Database on my domain hansteam.net that I need to move to my client's domain at halfpricetools.ca for a client. hansteam.net uses plesk and halfpricetools.ca uses cpanel. I've basically started coding a method of taking all of the information out of the first database but I'm still having to code the creation of the tables in the second database. If anybody here has a solution that involves a copy and paste more or less, i'd be very interested to hear of it!
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

dump the database structure and data using phpMyAdmin or the like then paste it to your new target using the same.

I've had to do this many times in the past and on a few occasions with extremely large databases. In those cases I had to break it into chunks and paste and execute small(er) amounts of data at a time.

with older versions of MySQL, you could simply grab three files and copy them from one machine to another, but I have not tried that with anything newer than ~Dec 2002.
hansteam
Forum Newbie
Posts: 11
Joined: Tue Aug 02, 2005 2:52 pm
Location: Minnesota

Post by hansteam »

Thanks a lot, that was really helpful. I would have wound up wasting A LOT of time on coding all of this. i don't know why I haven't used this program before, but I guess you learn a new thing every day :D
User avatar
voltrader
Forum Contributor
Posts: 223
Joined: Wed Jul 07, 2004 12:44 pm
Location: SF Bay Area

Post by voltrader »

If the db is really big, dump as a file and upload using bigdump. It's faster than cutting and pasting ad nauseum.
Post Reply