Transfer database

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
gjb79
Forum Commoner
Posts: 96
Joined: Fri Jul 18, 2003 6:35 am
Location: x <-- (DC)
Contact:

Transfer database

Post by gjb79 »

:?: Is there any quick and easy way to transfer the structure of an sql database from one server to a completly different server? I dont need the content, only the structure.

:arrow: However, I am interested in learning how to transfer structure and content over as well.

:wink: Thanks,
MishaPappa
Forum Newbie
Posts: 7
Joined: Wed Jul 30, 2003 7:49 am
Location: Location... Location

Post by MishaPappa »

Different SQL database platforms provide different means of exporting selected table(s) structure, data or both.

If a MySQL database, an easy method is to use a tool like phpMyAdmin and perform a schema dump. This will allow you to generate a text file containing the DML commands for creating the structure of the source database/table(s). This command file would then simply be executed at the target either thru direct MySQL command UI or phpMyAdmin...

YMMV based upon the source database vendor -- Have you reviewed the manual for your particular product concerning schema dumps?
User avatar
gjb79
Forum Commoner
Posts: 96
Joined: Fri Jul 18, 2003 6:35 am
Location: x <-- (DC)
Contact:

Ahh...

Post by gjb79 »

8O That makes since...

It is a mysql database with phpadmin on both servers.

I've always been afraid to use the dump commands as I fear it will dump all the information from the database, which is something I dont want to loose.

Thanks! :wink:
User avatar
scorphus
Forum Regular
Posts: 589
Joined: Fri May 09, 2003 11:53 pm
Location: Belo Horizonte, Brazil
Contact:

Post by scorphus »

Take a look to MySQL-Front here.

MySQL-Front has a feature to create an SQL script from the DB structure. Do it in server A then run the script on server B either using MySQL-Front or mysql console application. You can use it to copy the content too. Hope it helps!

Regards,
Scorphus.
User avatar
gjb79
Forum Commoner
Posts: 96
Joined: Fri Jul 18, 2003 6:35 am
Location: x <-- (DC)
Contact:

Thanks

Post by gjb79 »

Hey thanks a lot! Never knew it existed.

Mucho Thanks! :)
MishaPappa
Forum Newbie
Posts: 7
Joined: Wed Jul 30, 2003 7:49 am
Location: Location... Location

Post by MishaPappa »

gib79 - I understand your trepidation in experimenting with a "dump" of the database... the verb is misleading and suggestive of bad things!

The first time I experimented with phpMyAdmin schema dumps, I made multiple full backups of everything... then realized afterwards it was unnecessary... good to err on the side of caution though.

Sometimes, you need to be fearless and try something... just remember wear protection and don't try this at home...
User avatar
gjb79
Forum Commoner
Posts: 96
Joined: Fri Jul 18, 2003 6:35 am
Location: x <-- (DC)
Contact:

definately

Post by gjb79 »

hehe yeah, thats true. Things are not always as they seem.

:lol: Yep I'll be wearing plenty of protection on this venture.


Thanks!
Post Reply