Solved

How do you merge tables in PHPMyAdmin

Posted on 2013-06-05
11
1,094 Views
Last Modified: 2013-06-17
I have some tables from the Mantis Bug Tracking system. I was able to export and import the tables from one ISP to another ISP. Using PHPMyAdmin. Is there a way to merge the tables. When I imported the tables I thought they would overwrite the fresh install. Instead it seems to have installed a subset of tables which I illustrate in the image. Is there a way to pull those tables up to the top level and merge the tables in PHP MyAdmin. Please advise thank you.
PHPMyAdmin-Mantis.png
0
Comment
Question by:ruavol2
  • 6
  • 5
11 Comments
 
LVL 51

Accepted Solution

by:
Julian Hansen earned 500 total points
ID: 39221679
When you say merge do you mean merge the data or just merge the imported tables to the set of tables in the target database?
When I imported the tables I thought they would overwrite the fresh install
You say you expected the tables to be overwritten - is this what you are wanting to achieve?
0
 

Author Comment

by:ruavol2
ID: 39222567
Either Or. To know how to do either would be perfect. I have had need to do both actually in PHPMyAdmin.

It would appear that the Empty Mantis tables were installed when I created a fresh install of Mantis Big Tracker. Not knowing how PHPMyAdmin works it would be helpful to know how to replace the mantis tables vs how to merge them if that is possible.

I also do not understand the fact that I have to drill into the imported Mantis Tables. Why does that happen......I do not get it. Can I make those tables stay at the same level as the top level tables. If so how...?
0
 
LVL 51

Assisted Solution

by:Julian Hansen
Julian Hansen earned 500 total points
ID: 39222682
Merging data is a complicated operation - you have to deal with duplicate records and usually this is solved with a query.

PHPMyAdmin will import a script - but it is the script that determines how that data is treated.

You need to look at the exported file from your ISP to see what it is doing in the beginning of the file - sometimes a CREATE DATABASE is included in the script which you might not want if you want to overwrite the tables in an existing database - this is probably what is happening in your case.

First step - edith the exported .sql file and remove the create database instruction if it is there.
0
 

Author Comment

by:ruavol2
ID: 39223166
I am having some trouble on how to open the code on the SQL database adn remove that CREATE DB.
Any tips on how to edit or what to edit with.....? Sorry I am a bit of a novice on PHP MYAdmin. If this were MS SQL Server I would have been finished by now with your excellent answers.

The only thing I am trying to recover from this database is the MANTIS tables. The other tables are not needed. I imported the tables into another empty database DROPPED all irrelevant tables leaving the MANTIS ones and upon import. This is all the MANTIS and all the irrelevant ones. How do I take this table and edit the CREATE part out. Please sir.
db427685231.sql
0
 
LVL 51

Assisted Solution

by:Julian Hansen
Julian Hansen earned 500 total points
ID: 39223331
Ok probably not advisable posting a 46MB file ... but having said that here is what you do.

Open the file with a text editor - I used Notepad++

I had a look but there is no create database statement there.

Here is a list of tables that are created by that script.
Tables_in_ddddddd
_jwzrm8gydubug__seq
_jwzrm8gyducomponent__seq
_jwzrm8gyduos__seq
_jwzrm8gyduproject__seq
_jwzrm8gydustatus__seq
_jwzrm8gyduversion__seq
jwzrm8gyduattachment
jwzrm8gyduauth_group
jwzrm8gyduauth_group_seq
jwzrm8gyduauth_perm
jwzrm8gyduauth_user
jwzrm8gyduauth_user_seq
jwzrm8gydubug
jwzrm8gydubug_cc
jwzrm8gydubug_dependency
jwzrm8gydubug_group
jwzrm8gydubug_history
jwzrm8gydubug_vote
jwzrm8gyducomment
jwzrm8gyducomponent
jwzrm8gyduconfiguration
jwzrm8gydudatabase
jwzrm8gydudatabase_seq
jwzrm8gydugroup_perm
jwzrm8gyduos
jwzrm8gyduos_seq
jwzrm8gyduproject
jwzrm8gyduproject_group
jwzrm8gyduresolution
jwzrm8gyduresolution_seq
jwzrm8gydusaved_query
jwzrm8gyduseverity
jwzrm8gyduseverity_seq
jwzrm8gydusite
jwzrm8gydusite_seq
jwzrm8gydustatus
jwzrm8gydustatus_seq
jwzrm8gyduuser_group
jwzrm8gyduuser_perm
jwzrm8gyduuser_pref
jwzrm8gyduversion
mantis__bug_file_table
mantis__bug_history_table
mantis__bug_monitor_table
mantis__bug_relationship_table
mantis__bug_revision_table
mantis__bug_table
mantis__bug_tag_table
mantis__bug_text_table
mantis__bugnote_table
mantis__bugnote_text_table
mantis__category_table
mantis__config_table
mantis__custom_field_project_table
mantis__custom_field_string_table
mantis__custom_field_table
mantis__email_table
mantis__filters_table
mantis__news_table
mantis__plugin_table
mantis__project_file_table
mantis__project_hierarchy_table
mantis__project_table
mantis__project_user_list_table
mantis__project_version_table
mantis__sponsorship_table
mantis__tag_table
mantis__tokens_table
mantis__user_pref_table
mantis__user_print_pref_table
mantis__user_profile_table
mantis__user_table

Open in new window


Which ones do you want. I can export those and upload them.
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

Author Comment

by:ruavol2
ID: 39223659
Just the Mantis ones they all start with Mantis.

Then I have to import those into them into the new site That was where the fresh install originally was and the tables were added again in the sub category as the original question shows in the image there.
0
 
LVL 51

Expert Comment

by:Julian Hansen
ID: 39223977
Ok I was able to import that file fine. What process did you follow to import the database?
0
 

Author Comment

by:ruavol2
ID: 39225999
I followed the default settings on the import process. Browsed to the file I had and clicked Go. That was about it. No frills.Just straight up clicked import selected file. Go....?
0
 
LVL 51

Expert Comment

by:Julian Hansen
ID: 39226270
Ok well I can't find anything wrong with it - imports fine for me - if you like I can post the file I dumped from my DB that only has the Mantis tables in it ... other than that without being able to see exactly what you are doing can't say why it is not working in your particular instance.
0
 

Author Comment

by:ruavol2
ID: 39226379
Again the only problem is that when I import it into the database I have the import
1. Creates the subsection as shown in my original illustration.
2. I had already installed a fresh copy of Mantis "before I did the import". So there were already tables there but they were empty.
So I did the import thinking the data from it would overwrite the tables in the file. What happened was it created a subset of tables from the Mantis Import.

I guess the question is if I remove the empty Mantis tables with the import show up at the same level as the tables in the image above.....? the one I attached again here.
PHPMyAdmin-Mantis.png
0
 

Author Closing Comment

by:ruavol2
ID: 39253494
I fixed it by renaming the Mantis Tables. The import itself renamed the tables with an extra underscore. So the database originally just named the Tables prefixed with "Mantis_" the import renamed the Prefix "Mantis__" so I deleted the empty Mantis tables that were there from a previous install. Then ran the import of the new Mantis tables and then renamed the prefix by removing the extra underscore. It works now.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

760 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now