Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to transfer MySQL database to different webserver. HELP

Status
Not open for further replies.

LittleNFiesty

Technical User
Sep 26, 2006
46
0
0
US
I have recently inherited a php website. The news pages are created from a mySQL database, and it is not located in the root folder for the website on the previous webserver. I have access to the the MySQL administrator program and can access the database, but I can't find any where in there that I can copy(dup) the database.

I'm not familar with mySQL, so I'm not sure where to start. The website files are transfered to my webserver, but are still connecting with the other webserver for the database. Need to transfer database, but don't have a clue how.

Please help!
 
This is a 2 part question.

1. Backup the databases from webserver1, and load onto websever2

2. Modify the code that connects to the databases to connect to the new database in the new server.

For 1, the easiest way would be to perform a dump. Where the option is will depend on what admin program you are using, if its phpmyadmin you need to go to your table list and click on the Export tab. This should let you create a txt file containing all the commands to recreate the tables on the new server.




----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Im using MySQL Administrator, and the backup section is disabled. and I've looked around to see if there is a duplicate or export option and I can't find one.

Any ideas?
 
what platform are you running on ? (for both sides)
 
I don't know what platform it is currently on (I think windows not positive), but it's going to our webserver which is a windows server 2003.
 
Its not disabled, you just need to create a New Backup Project.

Click the New Project button at the bottom of the backup section.

Then Name your Project, and select the tables you wish to move across. You can go to the Advanced Tab if you want to specify any more settings.
Then Just click on Execute Backup Now it will ask you where you want to store the file.

Then just use that file to recreate the DB on your new server.


----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Sorry to be so long getting back.
If you have access to SQLserver it has some good tools to move data between db's.It basicaly sits on top of ODBC/OLE DB and generates the dynamic SQL to select an then insert.
I think you can get a trail version (120 days) which should do the above.
I only suggest this as an alternative. You are better off using the MYSQL tools to do everything.
Of course the very last resort would be to create your own extract/insert scriot in VBscript, PHP or any of native M$ languaes such as vb.net and C#.
Looking at Phil's suggestion looks a fair way to do it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top