Welcome to WebmasterWorld Guest from 18.104.22.168
Forum Moderators: travelin cat
I'm wondering if I should try to load the structure first and then put the data in from a text file using PhpmyAdmin.
Any thoughts on how to get this database moved to our new server are appreciated. It's a G5 dual-processor Xserve that we're anxious to get up and running.
% mysqldump --all-databases -u root -p > ~/Desktop/databases.sql
This will create a text file called "databases.sql" on your desktop, and the file will contain all of the commands you need to re-create your databases on your new server.
Then, to load the new databas, just copy the *.sql files over, set up mysql, and use this command in terminal:
% mysql -u root -p < /path/to/mysql_databases.sql
That will get your data back into database. You can then use your mysql terminal to set up the definitions that are required.
For more info, read the manual for mysqldump. I have only done this once, when we moves from our tower to the Xserve, but the manual proved to be priceless.
Hope this helps.
dir = database names
files in dir are tables and indexes etc.
so locate where your databases are located - possibly something like:
In here you'd have all your database dir's, in those dir's the tables.
Now that you have found them stop MySQL and just tar zip the directory structure.
tar -zcf mysqldatabases.tar.gz *
Now you have all your MySQL stuff in one zipped file. Copy this to the new server's data directory and unzip / untar it.
I'll try to dig into the manual to learn more about data management in MySQL now that we're on our own box. For updates, I'm used to emptying the tables and loading new data as text files in PhPmyAdmin. If you guys have any suggestions for a better system, please let me know. I store our data locally in Filemaker.
Loading data into and from text files would probably be OK, but it gives you the opportunity to make more mistakes than SQL dump files do.
When you guys work with data, how would you pull it from the MySQL server, edit it, and put it back on the server? My method at the moment is exporting a CSV file into Filemaker, editing the data, exporting a new CSV and using PhPmyAdmin to import the new text file.
CSV files are a good way to go in this case, if your a good DBA. If doing this, and you are going to edit the data in the interim, you should be aware of all links, etc. Editing things such as duplicate records without knowing what is linked to what, can be potentially disastrous. All I have to say is “If you’re going to do it that way, BE CAREFUL! And be sure you KNOW your database before 'correcting data'.” ;0)
My method at the moment is exporting a CSV file into Filemaker, editing the data, exporting a new CSV and using PhPmyAdmin to import the new text file.
If it makes you feel any better, that's exactly how I do it. Of course, the second JDBC comes online for the Mac version of Filemaker 7, neither of will have to worry about this ever again. :)
You would think filemaker would have a better system by now, but until then, I'll do the PhpMyAdmin method.