2.4.3 Repeated export and import with binary
patches (.met,
.mec)
Importing will affect large amounts of data, and to be able to
update existing data the binary patches must build up, maintain and use
mappings
from the structure and contents of one repository
to another. It is thus worth spending time making sure you understand a little
of what happens during import, especially if you want to repeatedly export and
import models from one repository to another, called the source and target
repositories here.
The target repository remembers from which source
repositories imported instances have come, so if the same graphs are exported
again later, the existing imported instances in the target repository are
updated, rather than creating new ‘duplicate’ instances. Previously
imported instances will thus be updated in the correct project automatically, if
the source repository name given when exporting the previously imported patch
was the same as for this patch. Exporters should thus take care to always use
the same, unique name for the source repository when exporting.
Recognizing previously imported types to be updated is
based on unique internal names, stored with each type, and is thus not dependent
on the name given for the source repository when exporting. However, if there
are instances of port types within type definitions, these instances are handled
in the same way as other instance data and the behavior is therefore affected by
the source repository name. When importing, you are expected to first open all
the areas where types to be updated exist. If a type is imported that already
exists in another, unopened project, MetaEdit+ will warn you and ask for
permission to open that project.
Whilst updating types works between any repositories,
updating instances works only in one direction: from the source (exporting)
repository to the target (importing) repository or repositories. It is not
possible to update the exported models in the source repository by importing the
same models back from the target repository.
Similarly, if A exports to B, and B exports to C, it is
not possible to update models in C by directly exporting from A. Instead, B must
import the models from A, and then re-export them for C to import. In many
situations, it would be better for A to export one patch at the start, which
both B and C could import. Later, A could export the newer versions of the same
models, and again both B and C could import that same patch.