NullVoid-Fixed

Wednesday, August 16, 2006

How do I export and move my database tables between servers or copy databases?



The first step is to dump out the contents of the database running on the old server.

You can do this by using the "mysqldump" command.
-> This command will create all the sql necessary to recreate all the tables in your database,
and is called a "dump".
-> A dump can either be printed to your screen, or if there is a lot of data, the dump can be
directed into to a file.

How to dump in a shell prompt using telnet or ssh type this all on 1 single line:

mysqldump -u DBUSER -p DBNAME > DBNAME.sql

substituting DBUSER with your MySQL username at the old host and DBNAME with your database name from the old host.

You will be prompted for your old host's password, which will not echo back at you as you type. After you provide the right password, you will have a file in your current directory called DBNAME.sql containing your entire database.

You'll need to get this file moved onto our system by either 1) FTP'ing it down to your own computer and then uploading it from there to your account on our system, or, 2) by moving the file directly from the host to your account here with the 'ftp' or 'scp' command.

After you have the moved the dumpfile from the old host to your account here, follow these instructions on how to import the dump into your MySQL database running here.

0 Comments:

Post a Comment

<< Home