Moving a database from old host to new host

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
MattSharp
Forum Commoner
Posts: 62
Joined: Wed Apr 24, 2002 2:25 pm

Moving a database from old host to new host

Post by MattSharp »

I am switching web hosts and I need to move my databases from one host to another. What is the easiest way to do this? I thought I could do it with phpMyAdmin but I can't figure it out. Any help would be great!
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

It kinda depends on which version of phpMyAdmin you have as to how you go about this but basically once you are viewing a database you should either have a link to export or towards the bottom of the page something that says 'View dump (schema) of table ' and then a whole bunch of options to choose.

If you choose all the tables in the database from the select box and 'data and structure' from the radio buttons and (if available) check the 'save as file' check box then press 'go' then you will either get prompted to save the file or (if you don't have that option) you will get a page of SQL INSERTS (that would have been what went into the .sql file anyway). Once you've got that you can either copy and paste the SQL into the 'Run SQL query/queries on database X' textarea in the new servers phpMyAdmin or enter the path to the .sql file and let phpMyAdmin import it.

You will have to create the database manually though before you can import the tables and data.

Mac
MattSharp
Forum Commoner
Posts: 62
Joined: Wed Apr 24, 2002 2:25 pm

Post by MattSharp »

Ok, that doesn't seem to be too hard. THanks I will give it a go.
Post Reply