The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
|
|
Merging two SLX databases
Posted: 14 Aug 07 8:31 AM
|
I need to merge a subset of the data from one SLX database into another one, so I created a group in the Source database, and tried to use the GroupCopy.exe to copy them. However I'm getting errors on Primary Key and Unique Index violations, like this:
Error! The statement has been terminated. : Violation of PRIMARY KEY constraint 'PK_ADDRESS'. Cannot insert duplicate key in object 'ADDRESS': ADDRESS Table: ADDRESSID = a6UJ9A004H9I: Unable to insert new record
Error! The statement has been terminated. : Cannot insert duplicate key row in object 'CONTACT' with unique index 'XPKCONTACT': CONTACT Table: CONTACTID = C6UJ9A0036BM: Unable to insert new record
These really are duplicate IDs, so do I need to write something to allocate them all new IDs, rather than using GroupCopy?
|
|
|
|
Re: Merging two SLX databases
Posted: 14 Aug 07 11:19 AM
|
I don't think GroupCopy was intended to be used in this way (i.e. with two difference databases). I think you need to develop a custom import, and you need to ensure that new record ids are generated for all records. |
|
|
|
Re: Merging two SLX databases
Posted: 14 Aug 07 1:46 PM
|
Yes, the short and ugly answer is that you can't do what you are trying to do.
FYI - for all new implementations we create a new primary key seed value that is something other than 6UJ9. If your systems had been set up this way then you could have used group copy. I am not posting this to rub it in but to hopefully prevent the same pain for others.
Timmus |
|
|
|
Re: Merging two SLX databases
Posted: 15 Aug 07 2:32 AM
|
Thanks Frank and Timmus, I thought I wouldn't be able to do this when I realised the primary key seed was the same in both DBs. These two systems were set up by two different BPs, one in the US and the other in the UK, and I guess they both left the default as 6UJ9. I have code to add Accounts/Contacts/Addresses etc already, so this shouldn't be too difficult. But I thought this was going to be sooo easy.
|
|
|
|
Re: Merging two SLX databases
Posted: 02 Sep 08 3:56 AM
|
I thought I might as well update this, since it has been referred to elsewhere.
Our new BP told us that what we were trying to do was not possible, so rising to the challenge I wrote a VB program which read all the data from the new DB to be merged into the Host DB, generated new IDs for all the rows, and sorted out all the linking. Since we already had a similar program importing leads from another system, it was pretty easy.
What wasn't easy was users and their security, so we just added the users in the SLX Administrator, and had a mapping table from the old IDs to the new ones.
Sorting out the attachments wasn't too difficult either. |
|
|
| |
| |
| |
|
Re: Merging two SLX databases
Posted: 16 Oct 08 9:27 AM
|
So basically as long as both the databases have different primary seed key, I shoul dbe able to use GroupCopy to import data? |
|
|
| |
| |
|
Re: Merging two SLX databases
Posted: 25 Nov 08 7:48 AM
|
Group Copy seems to work, but it does not copy the user information to the new datanase. Is there an easy method to do this? |
|
|
|
Re: Merging two SLX databases
Posted: 25 Nov 08 7:52 AM
|
See my reply above
[What wasn't easy was users and their security, so we just added the users in the SLX Administrator, and had a mapping table from the old IDs to the new ones]
I don't think there is any method, let alone an easy method |
|
|
| |
| |
|
Re: Merging two SLX databases
Posted: 26 Nov 08 8:12 AM
|
What I did was add all the users (there were not very many) into the destination database using SLX Admin, then set up a table with the USERID from the souce database and the USERID value from the destination database, and then whenever the program found a USERID column when it was adding an ACCOUNT/CONTACT etc. row, it would look up the value in the table and store it in the added row.
Something like this:
U6UJ9A00002G U6UJ9A00009K John Smith ... etc.
|
|
|
|
Re: Merging two SLX databases
Posted: 03 Dec 08 10:42 AM
|
As mentioned earlier, I am using group Copy...After Group copy is done, will simple update statements in SQL server (to replace old userid with new userid) do the trick? |
|
|
| |
|
Re: Merging two SLX databases
Posted: 22 Dec 08 8:52 AM
|
I have an old script lying around somewhere (yes it is written in Cypress Enable Basic and could be easily rewritten in .....basically it goes and wipesout and inserts a 'Z' in the 6th or 7th position of the ID fields for an entire database.....ID by ID....table by table.....
'6UJ9' means that both databases started out of the EVAL database after version 6.....(A2EK means version 1 (.97a) - 5.2.6)
then you simply bring over the other table(S) as needed.....
FullCopy and GroupCopy are NOT the answer.....
Scribe has been used by us in the past for this.....
The script is at home (just saw it over the weekend as I moved some files over on my server to the new 1 TB drive.....for $100, not bad.)
RJ
|
|
|
|