Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF Store » Model Migration: How to migrate repository models?
Model Migration: How to migrate repository models? [message #667192] Wed, 27 April 2011 06:26 Go to next message
philipp.hauer is currently offline philipp.hauer
Messages: 13
Registered: February 2010
Junior Member
Hello,

I want to test the model migration feature of EMFStore. I already played with COPE/Edapt and successfully migrate some models, but that was without EMFStore.

I want to migrate the models in the EMFStore repository, but I can't find out the way it works. Is there any button for starting the migration (model migrator is already generated) in the EMFStore Navigator View or anywhere else? Or should I do it programmatically? I didn't find any snippet or tutorial.

Do I overlook something obvious?

I'm looking forward to any response.

Best Regards
Philipp
Re: Model Migration: How to migrate repository models? [message #667343 is a reply to message #667192] Thu, 28 April 2011 05:02 Go to previous messageGo to next message
Maximilian Koegel is currently offline Maximilian Koegel
Messages: 184
Registered: July 2009
Senior Member
Hi Philipp,

no, you are not overlooking something obvious, you are looking at lack
of documentation ;). But I am happy to help you with this issue and
based on our interaction I will add documentation for this feature in
our wiki.
The migration feature of EMFStore can be installed from the update site.
It is optional and it integrates EMFStore with COPE/Edapt. EMFStore
(client and server) will automatically migrate existing models with
registered COPE/Edapt migrators as required. To determine the current
model version of your implementation you will need to register an
extension for the extension point "modelversion" in
org.unicase.emfstore. On initialization of the server and client the
current implementation┬┤s model version will be stored. If a client or
server start up, they will compare the persisted version number with the
current implementation┬┤s version number registered at the mentioned
extension point. If the numbers do differ than EMFStore will call Cope
to migrate the models instances. For example: If the persisted version
number is 1 and the current implementation┬┤s version number is 3,
EMFStore will call COPE and ask for a migration from 1 to 3. This also
implies, you have to keep in sync the version number at the extension
point and the cope versions.
It would be quite easy to use COPE in a different way with EMFStore, but
it is not implemented yet: COPE can derive the version number and
necessary migration steps from the models namespace URIs, if you change
the URIs with every release. With this approach it would be possible to
support multiple models in different versions and without registering a
model version extension.
To get a simple example running with the current implementation:
1. Add your model plugin to EMFStore and create a model instance.
2. Change the Ecore and generate a migrator with Cope.
3. The migrator plugin should now consist of 1 migration step
4. Add the migration plugin and COPE Migration feature to your Launch
config.
5. Add an extension in your model plugin to register version number "1"
for your model implementation:
<extension
id="org.unicase.model.unicaseModelVersion"
name="X Model Version"
point="org.unicase.metamodel.modelversion">
<ModelVersion
versionIdentifier="1">
</ModelVersion>
</extension>
6. Restart client and server, they will automatically migrate your model
instance on startup.

If you have any more questions or need help, do not hesitate to ask me
or contact me on Skype.

Cheers,
Maximilian


Am 27.04.2011 12:26, schrieb Philipp H.:
> Hello,
>
> I want to test the model migration feature of EMFStore. I already played
> with COPE/Edapt and successfully migrate some models, but that was
> without EMFStore.
>
> I want to migrate the models in the EMFStore repository, but I can't
> find out the way it works. Is there any button for starting the
> migration (model migrator is already generated) in the EMFStore
> Navigator View or anywhere else? Or should I do it programmatically? I
> didn't find any snippet or tutorial.
>
> Do I overlook something obvious?
>
> I'm looking forward to any response.
>
> Best Regards
> Philipp
Re: Model Migration: How to migrate repository models? [message #894016 is a reply to message #667343] Fri, 06 July 2012 08:07 Go to previous messageGo to next message
Axel Ruder is currently offline Axel Ruder
Messages: 4
Registered: July 2012
Junior Member
Hi Maximilian,

is the information you provided a year ago still valid?
I couldn't find a migration feature in the EMFStore Update site.

I run into these exceptions when running EMF-Store with a new metamodel-version, although the edapt-migrators should be registered. EMF-Store seems to be looking
for it's own migrator, though.

Any hints?
Axel

!MESSAGE Error while instantiating EMFStore Migrator
!STACK 0
org.eclipse.emf.emfstore.common.extensionpoint.ExtensionPointException: Value not found.
at org.eclipse.emf.emfstore.common.extensionpoint.ExtensionPoint.handleErrorOrNull(ExtensionPoint.java:225)
at org.eclipse.emf.emfstore.common.extensionpoint.ExtensionPoint.getFirst(ExtensionPoint.java:178)
at org.eclipse.emf.emfstore.migration.EMFStoreMigratorUtil.loadMigrator(EMFStoreMigratorUtil.java:69)
at org.eclipse.emf.emfstore.migration.EMFStoreMigratorUtil.isMigratorAvailable(EMFStoreMigratorUtil.java:41)
at org.eclipse.emf.emfstore.client.model.WorkspaceManager.migrateModel(WorkspaceManager.java:327)
at org.eclipse.emf.emfstore.client.model.WorkspaceManager.initWorkSpace(WorkspaceManager.java:206)
at org.eclipse.emf.emfstore.client.model.WorkspaceManager.initialize(WorkspaceManager.java:124)
at org.eclipse.emf.emfstore.client.model.WorkspaceManager.getInstance(WorkspaceManager.java:84)
at org.eclipse.emf.ecp.emfstorebridge.EMFECPWorkspace.<init>(EMFECPWorkspace.java:45)

...


!ENTRY org.eclipse.emf.emfstore.client 4 4 2012-07-06 13:07:27.716
!MESSAGE Model requires migration, but no migrators are registered!
!STACK 0
java.lang.IllegalStateException
at org.eclipse.emf.emfstore.client.model.WorkspaceManager.migrateModel(WorkspaceManager.java:329)
at org.eclipse.emf.emfstore.client.model.WorkspaceManager.initWorkSpace(WorkspaceManager.java:206)
at org.eclipse.emf.emfstore.client.model.WorkspaceManager.initialize(WorkspaceManager.java:124)
at org.eclipse.emf.emfstore.client.model.WorkspaceManager.getInstance(WorkspaceManager.java:84)
at org.eclipse.emf.ecp.emfstorebridge.EMFECPWorkspace.<init>(EMFECPWorkspace.java:45)
at org.eclipse.emf.ecp.emfstorebridge.EMFStoreECPWorkspaceProvider.getECPWorkspace(EMFStoreECPWorkspaceProvider.java:29)
at org.eclipse.emf.ecp.common.model.ECPWorkspaceManager.init(ECPWorkspaceManager.java:61)
Re: Model Migration: How to migrate repository models? [message #980706 is a reply to message #894016] Sun, 11 November 2012 17:50 Go to previous message
Jonas Helming is currently offline Jonas Helming
Messages: 408
Registered: July 2009
Senior Member
Hi,
this newsgroup is deprecated, you you kindly repost in the emft newsgroup?
regards
Jonas

Am 06.07.2012 14:07, schrieb Missing name Mising name:
> Hi Maximilian,
>
> is the information you provided a year ago still valid?
> I couldn't find a migration feature in the EMFStore Update site.
> I run into these exceptions when running EMF-Store with a new
> metamodel-version, although the edapt-migrators should be registered.
> EMF-Store seems to be looking for it's own migrator, though.
>
> Any hints?
> Axel
>
> !MESSAGE Error while instantiating EMFStore Migrator
> !STACK 0
> org.eclipse.emf.emfstore.common.extensionpoint.ExtensionPointException:
> Value not found.
> at
> org.eclipse.emf.emfstore.common.extensionpoint.ExtensionPoint.handleErrorOrNull(ExtensionPoint.java:225)
>
> at
> org.eclipse.emf.emfstore.common.extensionpoint.ExtensionPoint.getFirst(ExtensionPoint.java:178)
>
> at
> org.eclipse.emf.emfstore.migration.EMFStoreMigratorUtil.loadMigrator(EMFStoreMigratorUtil.java:69)
>
> at
> org.eclipse.emf.emfstore.migration.EMFStoreMigratorUtil.isMigratorAvailable(EMFStoreMigratorUtil.java:41)
>
> at
> org.eclipse.emf.emfstore.client.model.WorkspaceManager.migrateModel(WorkspaceManager.java:327)
>
> at
> org.eclipse.emf.emfstore.client.model.WorkspaceManager.initWorkSpace(WorkspaceManager.java:206)
>
> at
> org.eclipse.emf.emfstore.client.model.WorkspaceManager.initialize(WorkspaceManager.java:124)
>
> at
> org.eclipse.emf.emfstore.client.model.WorkspaceManager.getInstance(WorkspaceManager.java:84)
>
> at
> org.eclipse.emf.ecp.emfstorebridge.EMFECPWorkspace.<init>(EMFECPWorkspace.java:45)
>
>
> ..
>
>
> !ENTRY org.eclipse.emf.emfstore.client 4 4 2012-07-06 13:07:27.716
> !MESSAGE Model requires migration, but no migrators are registered!
> !STACK 0
> java.lang.IllegalStateException
> at
> org.eclipse.emf.emfstore.client.model.WorkspaceManager.migrateModel(WorkspaceManager.java:329)
>
> at
> org.eclipse.emf.emfstore.client.model.WorkspaceManager.initWorkSpace(WorkspaceManager.java:206)
>
> at
> org.eclipse.emf.emfstore.client.model.WorkspaceManager.initialize(WorkspaceManager.java:124)
>
> at
> org.eclipse.emf.emfstore.client.model.WorkspaceManager.getInstance(WorkspaceManager.java:84)
>
> at
> org.eclipse.emf.ecp.emfstorebridge.EMFECPWorkspace.<init>(EMFECPWorkspace.java:45)
>
> at
> org.eclipse.emf.ecp.emfstorebridge.EMFStoreECPWorkspaceProvider.getECPWorkspace(EMFStoreECPWorkspaceProvider.java:29)
>
> at
> org.eclipse.emf.ecp.common.model.ECPWorkspaceManager.init(ECPWorkspaceManager.java:61)
>
Previous Topic:IMPORTANT PLEASE READ: This newsgroup moved to the EMFT newsgroup
Next Topic:Version control on metamodels
Goto Forum:
  


Current Time: Thu Jul 24 09:08:13 EDT 2014

Powered by FUDForum. Page generated in 0.01831 seconds