Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2013-06-06
8
Medium Priority
?
295 Views
Last Modified: 2013-06-10
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.
0
Comment
Question by:ruavol2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 31

Assisted Solution

by:Frosty555
Frosty555 earned 668 total points
ID: 39227141
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
 

Author Comment

by:ruavol2
ID: 39227180
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
 
LVL 111

Assisted Solution

by:Ray Paseur
Ray Paseur earned 664 total points
ID: 39227244
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
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 
LVL 59

Expert Comment

by:Julian Hansen
ID: 39227330
0
 

Author Comment

by:ruavol2
ID: 39227444
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
 
LVL 59

Accepted Solution

by:
Julian Hansen earned 668 total points
ID: 39227528
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
 

Author Closing Comment

by:ruavol2
ID: 39236480
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
 
LVL 111

Expert Comment

by:Ray Paseur
ID: 39236515
Glad you got it pointed in the right direction!  Best regards, ~Ray
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller singl…
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
The viewer will learn how to count occurrences of each item in an array.
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question