Jump to content

merging xplanner tables


sgillesp

Recommended Posts

Hi- I have two mysql databases, both are 5.0.18. I have two dbs named "xplanner" that I would

like to merge into a single database instance. There are users who have the same name but different

ids and/or userids in the "person" table:

 

first database:

 

mysql> use xplanner

mysql> select name,userid,id from person;

| Gomer Pyle        | gomerp | 245 |

| Natas Kaupas    | natask | 246 |

| Jim Morrison      | jimm    | 247 |

 

second database:

 

mysql> select name,userid,id from person;

| Gomer Pyle        | gomerp | 123 |

| Natas Kaupas    | nkyay  | 124 |

| Jim Morrison      | jimmym| 125 |

 

I am planning on using either mysqldump, bcp or replication to get both databases synchronized.

Ultimately I am going to be moving a ton of projects from various xplanner application databases

into one single xplanner instance. I have tables that look like this:

 

+------------------------+

| attribute              |

| datasample            |

| history                |

| identifier            |

| integration            |

| iteration              |

| note                  |

| notification_receivers |

| patches                |

| permission            |

| person                |

| person_role            |

| project                |

| role                  |

| story                  |

| task                  |

| time_entry            |

| xdir                  |

| xfile                  |

+------------------------+

 

and I'm sure that if there are inconsistencies with the id post-move, there will be problems

getting the application to work for these users.

 

I am not a DBA, I'm a UNIX sysadmin who is stumbling in the dark with this MySQL stuff. Any

help would be most appreciated.

 

Thanks,

 

Scott

Link to comment
Share on other sites

 

On these two, the two tables are identical.

 

Going forward, there will be additional userids in separate "xplanner" databases that will need to

be merged. Also, there will be duplication, as shown below. Natas Kaupas could have ID=100

on one xplanner DB, 200 on a second, and 300 on a third. Or, Natas Kaupas could not exist

in some other xplanner DB, but I ultimately want Natas to be in the merged, final DB that

everything will move to, and I want him to have access to all the stuff he used to have access

to. Natas is an example, I'd like everyone to move without pain, if possible.

Link to comment
Share on other sites

It will take some planning and elbow grease.  Also, some down time for registering new users where you can perform the merge.  Probably just a DISTICT query on username from each table and use those values to create the merged table.  Then, most likely, update the permission and person_role table to reflect the new userId values.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.