Book a Demo

Author Topic: Lost package after *.xmi import  (Read 7158 times)

jakson

  • EA User
  • **
  • Posts: 41
  • Karma: +0/-0
    • View Profile
Lost package after *.xmi import
« on: January 28, 2015, 05:39:37 pm »
I was working on local copy of production database.
At the end of the work I've exported whole package named "abc" (with tens of diagrams and objects) to *.xmi file,
but before doing that I've changed package name to "abc-new_version".

When I was trying to import that package into production database there was an error "packages name conflict" (or sth similar).
So I moved "abc-new_version" to new, empty package named "test_versions", exported it to *.xmi and tried to import it on the other database.

There was no error and everything seemed well, but now I can't find "abc" package on production database (?!).
I can't find packages "abc-new_version" and "test_versions" neither (?!).
Why did this happen?

How can I export (from local db) and import (to production db) existing package to package e.g. "test_versions"?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Lost package after *.xmi import
« Reply #1 on: January 28, 2015, 07:23:09 pm »
I don't see a reason why this shouldn't work.
If you create a new package and import that into the production model it should at least create this new package.

I've done this many times without any issues.

You could maybe run the project integrity check on both models before exporting/importing.

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Lost package after *.xmi import
« Reply #2 on: January 28, 2015, 09:01:56 pm »
The problem is: your package has the same GUID. You renamed it and tried to import it where the GUID already existed. So that caused the conflict. Solution: create a new package in your working copy, move your new stuff into that and ex-/import this package. This avoids the conflict. You have to move the changed elements back to where they belong and delete the temp package at last.

q.

jakson

  • EA User
  • **
  • Posts: 41
  • Karma: +0/-0
    • View Profile
Re: Lost package after *.xmi import
« Reply #3 on: January 29, 2015, 01:09:20 am »
Quote
The problem is: your package has the same GUID. You renamed it and tried to import it where the GUID already existed.
It looks like that's it -
- I've found disappeared package "abc" in EA database through SQL
and it has no parent (that's why it "disappeared" in packages tree).

Precisely: disappeared package Parent_ID wasn't NULL,
but there was no package with Package_ID = Parent_ID.

After changing Parent_ID to proper Package_ID the package "abc" has appeared,
but it contains only the imported data -
- all previously existing data was overwritten and the rest was lost :(.

I should backup EA database more than once a day :/

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Lost package after *.xmi import
« Reply #4 on: January 29, 2015, 01:40:40 am »
A project integrity check would have probably solved this, or at least recover the package without parent.

Geert

jakson

  • EA User
  • **
  • Posts: 41
  • Karma: +0/-0
    • View Profile
Re: Lost package after *.xmi import
« Reply #5 on: January 29, 2015, 07:19:13 pm »
Quote
The problem is: your package has the same GUID. You renamed it and tried to import it where the GUID already existed. So that caused the conflict. Solution: create a new package in your working copy, move your new stuff into that
Ok, so the root package (the one I created) has new, unique GUID,
than I move to it packages and elements, which have unchanged GUID.
Than I export that root package from local db and import it to remote/main db.
There will be some conflicts?
« Last Edit: January 29, 2015, 07:35:43 pm by jakson »

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Lost package after *.xmi import
« Reply #6 on: January 29, 2015, 09:17:31 pm »
Elements are save. Packages are tricky. I'm pretty sure (not 100%!) EA will just move the packages. The best for offline work is to just fiddle with elements/diagrams. Or you take a package and ex-/import that without renaming it. This will of course replace the whole package and not merge changes. The safest would be to use VC for distributed work.

q.

jakson

  • EA User
  • **
  • Posts: 41
  • Karma: +0/-0
    • View Profile
Re: Lost package after *.xmi import
« Reply #7 on: January 29, 2015, 10:10:14 pm »
Quote
The safest would be to use VC for distributed work.

What does VC stand for?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Lost package after *.xmi import
« Reply #8 on: January 29, 2015, 11:05:38 pm »
Version Control

q.

jakson

  • EA User
  • **
  • Posts: 41
  • Karma: +0/-0
    • View Profile
Re: Lost package after *.xmi import
« Reply #9 on: January 30, 2015, 07:22:40 pm »
Quote
A project integrity check would have probably solved this, or at least recover the package without parent.
I've found that lost/hidden package after project integrity check
and I find it as easier way than manual setting parent id in database.

Finally conclusions:
I should import *.xmi package with Strip GUIDs checked.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Lost package after *.xmi import
« Reply #10 on: January 31, 2015, 10:34:11 am »
You can do that, but know that this will create all new elements and the connection to the existing elements is completely lost.

q.

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Lost package after *.xmi import
« Reply #11 on: February 03, 2015, 02:41:14 am »
Baselines help a lot in these situations, since they allow you to see the changes and determine which ones you want to import. The import process is also better than with plain XMI.

The way to do it is not to export the package from your "off-line" project, but to take a baseline and export that to a file.

In your "on-line" project, first take a new baseline of the package so you can revert to that if all else fails.
Then import the baseline from the file (you have to specify a new version name for it). This does not make any changes to the model, it only makes the baseline available in the "on-line" project.
Finally, select the imported baseline and check the differences. From the comparison window you can selectively merge changes into the model.

Note that there is no confirmation if you click the "Restore to Baseline" button, EA just sets about overwriting the model contents with the baseline contents -- which is why it is a veeeerrrry goooooooddd idea to take that additional baseline before you do the import.

Cheers,


/Uffe
My theories are always correct, just apply them to the right reality.