Moving Data in PHP MySQL from one table with records to the same named table with no records

I have a database i have installed with a product open source Bug Ticketing system called Mantis. I installed Mantis on a new website with a new ISP. (no Records in this DB) The old ISP had the same version of Mantis with just a few records in it I wanted to move those records....that data to the new site. Is this possible if so how do I do that. Please advise thank you.
ruavol2Tableau Trainer & Consultant Sales Exec.Asked:
Who is Participating?
 
Julian HansenConnect With a Mentor Commented:
I think Ray has spotted the problem. Just checked the data you posted in my db and the tables have double underscores.

What is the correct name for the tables - with or without double underscores?

You could probably do a search and replace on the sql file you posted - but I had to kill my text editor while editing that file - it choked after I got 1500 or so lines down. Might be easier to just delete the tables that are there and rename the new ones.

With regard to merging - at the data level you will need a script - PHPMyAdmin just runs SQL queries and the ones in the export dump are create and insert statements - so they will overwrite / add to what you have but won't merge - but from what I gather the other tables are throw away anyway?
0
 
Frosty555Connect With a Mentor Commented:
If this is a one-time thing, the easiest way to do it is to mysqldump the contents of the old table, manually edit the .SQL dump file to have the new database/table name, and then execute the dump query against your MySQL server.

If you have PHPMyAdmin installed, you can use the Export/Import options to do this, otherwise you can use the mysqldump command line utility on your server

http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html
0
 
ruavol2Tableau Trainer & Consultant Sales Exec.Author Commented:
I have already imported the tables they are in the DB twice. In fact they have a weird icon and the column under the PHP MyAdmin Table list on the far left. See image attached.
So the tables are in there twice. One empty and one with records. Is there a simply way to say put these records in that table with the same name......? Like Mantis_Users    to   Mantis_Users

Note the highlighted area in yellow and the Mantis (31) representing the tables I imported with records the Mantis Tables at the higher level are the tables I installed to for the website and are empty........? Does that help
PHPMyAdmin-Mantis.png
0
Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

 
Ray PaseurConnect With a Mentor Commented:
Hmm... Some of the tables seem to have a single underscore in the name and others seem to have a double underscore.  Am I seeing that correctly?
0
 
Julian HansenCommented:
0
 
ruavol2Tableau Trainer & Consultant Sales Exec.Author Commented:
julianH Yes I do but that seem to not be answered about a data merge but a table merge. This question asks only about merging the data.

Ray_Paseur Yes there seems to be a double underscore there. Yes and I see why the double underscore seems to signify where the imported tables are They seem to follow the Mantis (31)  tables that are there and flow to the bottom of the 31 list.
0
 
ruavol2Tableau Trainer & Consultant Sales Exec.Author Commented:
Thanks to you guys I figured it out. It would seem all I had to do was to delete or drop the empty tables in PHPMyAdmin and then go in and rename the tables by removing the "extra underscore" created apparently by the import. The import put a Mantis__??? infront of the imported tables. It seems to have worked by simply removing the one underscore. Thanks for your help gentlemen....
0
 
Ray PaseurCommented:
Glad you got it pointed in the right direction!  Best regards, ~Ray
0
All Courses

From novice to tech pro — start learning today.