diff --git a/models/src/main/java/org/onap/policy/clamp/models/acm/concepts/AutomationComposition.java b/models/src/main/java/org/onap/policy/clamp/models/acm/concepts/AutomationComposition.java
old mode 100644
new mode 100755
index b92b03f..0cf1f99
--- a/models/src/main/java/org/onap/policy/clamp/models/acm/concepts/AutomationComposition.java
+++ b/models/src/main/java/org/onap/policy/clamp/models/acm/concepts/AutomationComposition.java
@@ -42,6 +42,8 @@
     @NonNull
     private UUID compositionId;
 
+    private UUID compositionTargetId;
+
     private Boolean restarting;
 
     @NonNull
@@ -63,6 +65,7 @@
         super(otherAutomationComposition);
         this.instanceId = otherAutomationComposition.instanceId;
         this.compositionId = otherAutomationComposition.compositionId;
+        this.compositionTargetId = otherAutomationComposition.compositionTargetId;
         this.restarting = otherAutomationComposition.restarting;
         this.deployState = otherAutomationComposition.deployState;
         this.lockState = otherAutomationComposition.lockState;
diff --git a/models/src/main/java/org/onap/policy/clamp/models/acm/concepts/DeployState.java b/models/src/main/java/org/onap/policy/clamp/models/acm/concepts/DeployState.java
old mode 100644
new mode 100755
index 9dde703..57669fe
--- a/models/src/main/java/org/onap/policy/clamp/models/acm/concepts/DeployState.java
+++ b/models/src/main/java/org/onap/policy/clamp/models/acm/concepts/DeployState.java
@@ -27,5 +27,6 @@
     UNDEPLOYING,
     DELETING,
     DELETED,
-    UPDATING
+    UPDATING,
+    MIGRATING
 }
diff --git a/models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant/AutomationCompositionMigration.java b/models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant/AutomationCompositionMigration.java
new file mode 100755
index 0000000..dd5e528
--- /dev/null
+++ b/models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant/AutomationCompositionMigration.java
@@ -0,0 +1,43 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2023 Nordix Foundation.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.policy.clamp.models.acm.messages.dmaap.participant;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.UUID;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+import org.onap.policy.clamp.models.acm.concepts.ParticipantDeploy;
+
+@Getter
+@Setter
+@ToString(callSuper = true)
+public class AutomationCompositionMigration extends ParticipantMessage {
+
+    private UUID compositionTargetId;
+    // A list of updates to AC element properties
+    private List<ParticipantDeploy> participantUpdatesList = new ArrayList<>();
+
+    public AutomationCompositionMigration() {
+        super(ParticipantMessageType.AUTOMATION_COMPOSITION_MIGRATION);
+    }
+}
diff --git a/models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant/ParticipantMessageType.java b/models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant/ParticipantMessageType.java
old mode 100644
new mode 100755
index c42778a..7609acc
--- a/models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant/ParticipantMessageType.java
+++ b/models/src/main/java/org/onap/policy/clamp/models/acm/messages/dmaap/participant/ParticipantMessageType.java
@@ -104,5 +104,11 @@
     /**
      * Used by runtime to send composition and instances to a restarted participant.
      */
-    PARTICIPANT_RESTART
+    PARTICIPANT_RESTART,
+
+    /**
+     * Used by acm runtime to migrate from a composition to another one in participants, triggers a
+     * AUTOMATION_COMPOSITION_MIGRATION message with result of AUTOMATION_COMPOSITION_STATE_CHANGE operation.
+     */
+    AUTOMATION_COMPOSITION_MIGRATION
 }
diff --git a/models/src/main/java/org/onap/policy/clamp/models/acm/messages/rest/instantiation/DeployOrder.java b/models/src/main/java/org/onap/policy/clamp/models/acm/messages/rest/instantiation/DeployOrder.java
old mode 100644
new mode 100755
index 24197f1..758a505
--- a/models/src/main/java/org/onap/policy/clamp/models/acm/messages/rest/instantiation/DeployOrder.java
+++ b/models/src/main/java/org/onap/policy/clamp/models/acm/messages/rest/instantiation/DeployOrder.java
@@ -26,5 +26,6 @@
     DEPLOY,
     DELETE,
     UPDATE,
-    RESTARTING
+    RESTARTING,
+    MIGRATE
 }
diff --git a/models/src/main/java/org/onap/policy/clamp/models/acm/persistence/concepts/JpaAutomationComposition.java b/models/src/main/java/org/onap/policy/clamp/models/acm/persistence/concepts/JpaAutomationComposition.java
index 1047921..5e27fde 100755
--- a/models/src/main/java/org/onap/policy/clamp/models/acm/persistence/concepts/JpaAutomationComposition.java
+++ b/models/src/main/java/org/onap/policy/clamp/models/acm/persistence/concepts/JpaAutomationComposition.java
@@ -81,6 +81,9 @@
     private String compositionId;
 
     @Column
+    private String compositionTargetId;
+
+    @Column
     private Boolean restarting;
 
     @Column
@@ -106,8 +109,8 @@
      * The Default Constructor creates a {@link JpaAutomationComposition} object with a null key.
      */
     public JpaAutomationComposition() {
-        this(UUID.randomUUID().toString(), new PfConceptKey(), UUID.randomUUID().toString(),
-                new ArrayList<>(), DeployState.UNDEPLOYED, LockState.NONE);
+        this(UUID.randomUUID().toString(), new PfConceptKey(), UUID.randomUUID().toString(), new ArrayList<>(),
+                DeployState.UNDEPLOYED, LockState.NONE);
     }
 
     /**
@@ -121,8 +124,7 @@
      * @param lockState the Lock State
      */
     public JpaAutomationComposition(@NonNull final String instanceId, @NonNull final PfConceptKey key,
-            @NonNull final String compositionId,
-            @NonNull final List<JpaAutomationCompositionElement> elements,
+            @NonNull final String compositionId, @NonNull final List<JpaAutomationCompositionElement> elements,
             @NonNull final DeployState deployState, @NonNull final LockState lockState) {
         this.instanceId = instanceId;
         this.name = key.getName();
@@ -143,6 +145,7 @@
         this.name = copyConcept.name;
         this.version = copyConcept.version;
         this.compositionId = copyConcept.compositionId;
+        this.compositionTargetId = copyConcept.compositionTargetId;
         this.restarting = copyConcept.restarting;
         this.deployState = copyConcept.deployState;
         this.lockState = copyConcept.lockState;
@@ -168,6 +171,9 @@
         automationComposition.setName(name);
         automationComposition.setVersion(version);
         automationComposition.setCompositionId(UUID.fromString(compositionId));
+        if (compositionTargetId != null) {
+            automationComposition.setCompositionTargetId(UUID.fromString(compositionTargetId));
+        }
         automationComposition.setRestarting(restarting);
         automationComposition.setDeployState(deployState);
         automationComposition.setLockState(lockState);
@@ -187,6 +193,9 @@
         this.name = automationComposition.getName();
         this.version = automationComposition.getVersion();
         this.compositionId = automationComposition.getCompositionId().toString();
+        if (automationComposition.getCompositionTargetId() != null) {
+            this.compositionTargetId = automationComposition.getCompositionTargetId().toString();
+        }
         this.restarting = automationComposition.getRestarting();
         this.deployState = automationComposition.getDeployState();
         this.lockState = automationComposition.getLockState();
@@ -230,6 +239,11 @@
             return result;
         }
 
+        result = ObjectUtils.compare(compositionTargetId, other.compositionTargetId);
+        if (result != 0) {
+            return result;
+        }
+
         result = ObjectUtils.compare(restarting, other.restarting);
         if (result != 0) {
             return result;
diff --git a/models/src/main/java/org/onap/policy/clamp/models/acm/persistence/provider/AcInstanceStateResolver.java b/models/src/main/java/org/onap/policy/clamp/models/acm/persistence/provider/AcInstanceStateResolver.java
old mode 100644
new mode 100755
index e2f4fdf..7fed8a7
--- a/models/src/main/java/org/onap/policy/clamp/models/acm/persistence/provider/AcInstanceStateResolver.java
+++ b/models/src/main/java/org/onap/policy/clamp/models/acm/persistence/provider/AcInstanceStateResolver.java
@@ -38,6 +38,7 @@
     private static final String UNDEPLOYING = DeployState.UNDEPLOYING.name();
     private static final String UPDATING = DeployState.UPDATING.name();
     private static final String DELETING = DeployState.DELETING.name();
+    private static final String MIGRATING = DeployState.MIGRATING.name();
 
     private static final String LOCKED = LockState.LOCKED.name();
     private static final String LOCKING = LockState.LOCKING.name();
@@ -58,6 +59,7 @@
     public static final String DELETE = DeployOrder.DELETE.name();
     public static final String LOCK = LockOrder.LOCK.name();
     public static final String UNLOCK = LockOrder.UNLOCK.name();
+    public static final String MIGRATE = DeployOrder.MIGRATE.name();
     public static final String NONE = "NONE";
 
     /**
@@ -72,23 +74,25 @@
         this.graph.put(new String[] {DELETE, LOCK_NONE, UNDEPLOYED, LOCK_NONE, NO_ERROR}, DELETE);
         this.graph.put(new String[] {DEPLOY_NONE, UNLOCK, DEPLOYED, LOCKED, NO_ERROR}, UNLOCK);
         this.graph.put(new String[] {DEPLOY_NONE, LOCK, DEPLOYED, UNLOCKED, NO_ERROR}, LOCK);
+        this.graph.put(new String[] {MIGRATE, LOCK_NONE, DEPLOYED, LOCKED, NO_ERROR}, MIGRATE);
 
         // failed
         this.graph.put(new String[] {DEPLOY, LOCK_NONE, UNDEPLOYING, STATE_LOCKED_NONE, FAILED}, DEPLOY);
-        this.graph.put(new String[] {UNDEPLOY, LOCK_NONE, UNDEPLOYING, STATE_LOCKED_NONE, FAILED}, UNDEPLOY);
-        this.graph.put(new String[] {UNDEPLOY, LOCK_NONE, UPDATING, STATE_LOCKED_NONE, FAILED}, UNDEPLOY);
-
         this.graph.put(new String[] {DEPLOY, LOCK_NONE, DEPLOYING, STATE_LOCKED_NONE, FAILED}, DEPLOY);
+
+        this.graph.put(new String[] {UNDEPLOY, LOCK_NONE, UNDEPLOYING, STATE_LOCKED_NONE, FAILED}, UNDEPLOY);
+        this.graph.put(new String[] {UNDEPLOY, LOCK_NONE, UPDATING, LOCKED, FAILED}, UNDEPLOY);
+        this.graph.put(new String[] {UNDEPLOY, LOCK_NONE, MIGRATING, LOCKED, FAILED}, UNDEPLOY);
         this.graph.put(new String[] {UNDEPLOY, LOCK_NONE, DEPLOYING, STATE_LOCKED_NONE, FAILED}, UNDEPLOY);
 
         this.graph.put(new String[] {DELETE, LOCK_NONE, DELETING, LOCK_NONE, FAILED}, DELETE);
 
         this.graph.put(new String[] {DEPLOY_NONE, UNLOCK, DEPLOYED, LOCKING, FAILED}, UNLOCK);
-        this.graph.put(new String[] {DEPLOY_NONE, LOCK, DEPLOYED, LOCKING, FAILED}, LOCK);
-
-        this.graph.put(new String[] {DEPLOY_NONE, LOCK, DEPLOYED, UNLOCKING, FAILED}, LOCK);
         this.graph.put(new String[] {DEPLOY_NONE, UNLOCK, DEPLOYED, UNLOCKING, FAILED}, UNLOCK);
 
+        this.graph.put(new String[] {DEPLOY_NONE, LOCK, DEPLOYED, LOCKING, FAILED}, LOCK);
+        this.graph.put(new String[] {DEPLOY_NONE, LOCK, DEPLOYED, UNLOCKING, FAILED}, LOCK);
+
         // timeout
         this.graph.put(new String[] {DEPLOY, LOCK_NONE, UNDEPLOYING, STATE_LOCKED_NONE, TIMEOUT}, DEPLOY);
         this.graph.put(new String[] {UNDEPLOY, LOCK_NONE, UNDEPLOYING, STATE_LOCKED_NONE, TIMEOUT}, UNDEPLOY);
diff --git a/models/src/main/java/org/onap/policy/clamp/models/acm/utils/AcmUtils.java b/models/src/main/java/org/onap/policy/clamp/models/acm/utils/AcmUtils.java
index 258c6dc..fe44050 100755
--- a/models/src/main/java/org/onap/policy/clamp/models/acm/utils/AcmUtils.java
+++ b/models/src/main/java/org/onap/policy/clamp/models/acm/utils/AcmUtils.java
@@ -45,6 +45,7 @@
 import org.onap.policy.clamp.models.acm.concepts.LockState;
 import org.onap.policy.clamp.models.acm.concepts.NodeTemplateState;
 import org.onap.policy.clamp.models.acm.concepts.ParticipantDefinition;
+import org.onap.policy.clamp.models.acm.concepts.ParticipantDeploy;
 import org.onap.policy.clamp.models.acm.messages.rest.instantiation.DeployOrder;
 import org.onap.policy.clamp.models.acm.messages.rest.instantiation.LockOrder;
 import org.onap.policy.common.parameters.BeanValidationResult;
@@ -289,7 +290,8 @@
     public static boolean isInTransitionalState(DeployState deployState, LockState lockState) {
         return DeployState.DEPLOYING.equals(deployState) || DeployState.UNDEPLOYING.equals(deployState)
                 || LockState.LOCKING.equals(lockState) || LockState.UNLOCKING.equals(lockState)
-                || DeployState.DELETING.equals(deployState) || DeployState.UPDATING.equals(deployState);
+                || DeployState.DELETING.equals(deployState) || DeployState.UPDATING.equals(deployState)
+                || DeployState.MIGRATING.equals(deployState);
     }
 
     /**
@@ -299,24 +301,12 @@
      * @return the DeployOrder
      */
     public static DeployOrder stateDeployToOrder(DeployState deployState) {
-        DeployOrder result = null;
-        switch (deployState) {
-            case DEPLOYING:
-                result = DeployOrder.DEPLOY;
-                break;
-
-            case UNDEPLOYING:
-                result = DeployOrder.UNDEPLOY;
-                break;
-
-            case DELETING:
-                result = DeployOrder.DELETE;
-                break;
-
-            default:
-                result = DeployOrder.NONE;
-        }
-        return result;
+        return switch (deployState) {
+            case DEPLOYING -> DeployOrder.DEPLOY;
+            case UNDEPLOYING -> DeployOrder.UNDEPLOY;
+            case DELETING -> DeployOrder.DELETE;
+            default -> DeployOrder.NONE;
+        };
     }
 
     /**
@@ -341,24 +331,12 @@
      * @return the DeployState
      */
     public static DeployState deployCompleted(DeployState deployState) {
-        DeployState result = null;
-        switch (deployState) {
-            case UPDATING, DEPLOYING:
-                result = DeployState.DEPLOYED;
-                break;
-
-            case UNDEPLOYING:
-                result = DeployState.UNDEPLOYED;
-                break;
-
-            case DELETING:
-                result = DeployState.DELETED;
-                break;
-
-            default:
-                return deployState;
-        }
-        return result;
+        return switch (deployState) {
+            case MIGRATING, UPDATING, DEPLOYING -> DeployState.DEPLOYED;
+            case UNDEPLOYING -> DeployState.UNDEPLOYED;
+            case DELETING -> DeployState.DELETED;
+            default -> deployState;
+        };
     }
 
     /**
@@ -427,6 +405,30 @@
     }
 
     /**
+     * Create a list of AcElementDeploy for update/migrate message.
+     *
+     * @param automationComposition the AutomationComposition
+     * @param deployOrder the DeployOrder
+     */
+    public static List<ParticipantDeploy> createParticipantDeployList(AutomationComposition automationComposition,
+            DeployOrder deployOrder) {
+        Map<UUID, List<AcElementDeploy>> map = new HashMap<>();
+        for (var element : automationComposition.getElements().values()) {
+            var acElementDeploy = createAcElementDeploy(element, deployOrder);
+            map.putIfAbsent(element.getParticipantId(), new ArrayList<>());
+            map.get(element.getParticipantId()).add(acElementDeploy);
+        }
+        List<ParticipantDeploy> participantDeploys = new ArrayList<>();
+        for (var entry : map.entrySet()) {
+            var participantDeploy = new ParticipantDeploy();
+            participantDeploy.setParticipantId(entry.getKey());
+            participantDeploy.setAcElementList(entry.getValue());
+            participantDeploys.add(participantDeploy);
+        }
+        return participantDeploys;
+    }
+
+    /**
      * Create a new AcElementRestart from an AutomationCompositionElement.
      *
      * @param element the AutomationCompositionElement
diff --git a/models/src/test/java/org/onap/policy/clamp/models/acm/persistence/concepts/JpaAutomationCompositionTest.java b/models/src/test/java/org/onap/policy/clamp/models/acm/persistence/concepts/JpaAutomationCompositionTest.java
old mode 100644
new mode 100755
index 04a8744..697b4e1
--- a/models/src/test/java/org/onap/policy/clamp/models/acm/persistence/concepts/JpaAutomationCompositionTest.java
+++ b/models/src/test/java/org/onap/policy/clamp/models/acm/persistence/concepts/JpaAutomationCompositionTest.java
@@ -62,28 +62,28 @@
         }).hasMessageMatching(NULL_INSTANCE_ID_ERROR);
 
         assertThatThrownBy(() -> {
-            new JpaAutomationComposition(INSTANCE_ID, null, null, new ArrayList<>(),
-                DeployState.UNDEPLOYED, LockState.LOCKED);
+            new JpaAutomationComposition(INSTANCE_ID, null, null, new ArrayList<>(), DeployState.UNDEPLOYED,
+                    LockState.LOCKED);
         }).hasMessageMatching("key" + NULL_TEXT_ERROR);
 
         assertThatThrownBy(() -> {
-            new JpaAutomationComposition(INSTANCE_ID, new PfConceptKey(), null,
-                    new ArrayList<>(), DeployState.UNDEPLOYED, LockState.LOCKED);
+            new JpaAutomationComposition(INSTANCE_ID, new PfConceptKey(), null, new ArrayList<>(),
+                    DeployState.UNDEPLOYED, LockState.LOCKED);
         }).hasMessageMatching("compositionId" + NULL_TEXT_ERROR);
 
         assertThatThrownBy(() -> {
-            new JpaAutomationComposition(INSTANCE_ID, new PfConceptKey(), COMPOSITION_ID.toString(),
-                    null, DeployState.UNDEPLOYED, LockState.LOCKED);
+            new JpaAutomationComposition(INSTANCE_ID, new PfConceptKey(), COMPOSITION_ID.toString(), null,
+                    DeployState.UNDEPLOYED, LockState.LOCKED);
         }).hasMessageMatching("elements" + NULL_TEXT_ERROR);
 
         assertThatThrownBy(() -> {
-            new JpaAutomationComposition(INSTANCE_ID, new PfConceptKey(), COMPOSITION_ID.toString(),
-                new ArrayList<>(), null, LockState.LOCKED);
+            new JpaAutomationComposition(INSTANCE_ID, new PfConceptKey(), COMPOSITION_ID.toString(), new ArrayList<>(),
+                    null, LockState.LOCKED);
         }).hasMessageMatching("deployState" + NULL_TEXT_ERROR);
 
         assertThatThrownBy(() -> {
-            new JpaAutomationComposition(INSTANCE_ID, new PfConceptKey(), COMPOSITION_ID.toString(),
-                new ArrayList<>(), DeployState.UNDEPLOYED, null);
+            new JpaAutomationComposition(INSTANCE_ID, new PfConceptKey(), COMPOSITION_ID.toString(), new ArrayList<>(),
+                    DeployState.UNDEPLOYED, null);
         }).hasMessageMatching("lockState" + NULL_TEXT_ERROR);
 
         assertNotNull(new JpaAutomationComposition());
@@ -93,29 +93,34 @@
 
     @Test
     void testJpaAutomationComposition() {
-        var testJpaAutomationComposition = createJpaAutomationCompositionInstance();
+        var jpaAutomationComposition = createJpaAutomationCompositionInstance();
 
-        var participant = createAutomationCompositionInstance();
-        assertEquals(participant, testJpaAutomationComposition.toAuthorative());
+        var automationComposition = createAutomationCompositionInstance();
+        assertEquals(automationComposition, jpaAutomationComposition.toAuthorative());
+
+        var target = UUID.randomUUID();
+        jpaAutomationComposition.setCompositionTargetId(target.toString());
+        automationComposition.setCompositionTargetId(target);
+        assertEquals(automationComposition, jpaAutomationComposition.toAuthorative());
 
         assertThatThrownBy(() -> {
-            testJpaAutomationComposition.fromAuthorative(null);
+            jpaAutomationComposition.fromAuthorative(null);
         }).hasMessageMatching("automationComposition is marked .*ull but is null");
 
         assertThatThrownBy(() -> new JpaAutomationComposition((JpaAutomationComposition) null))
                 .isInstanceOf(NullPointerException.class);
 
-        var testJpaAutomationCompositionFa = new JpaAutomationComposition();
-        testJpaAutomationCompositionFa.setInstanceId(null);
-        testJpaAutomationCompositionFa.fromAuthorative(participant);
-        assertEquals(testJpaAutomationComposition, testJpaAutomationCompositionFa);
+        var jpaAutomationCompositionFa = new JpaAutomationComposition();
+        jpaAutomationCompositionFa.setInstanceId(null);
+        jpaAutomationCompositionFa.fromAuthorative(automationComposition);
+        assertEquals(jpaAutomationComposition, jpaAutomationCompositionFa);
 
-        assertEquals("automation-composition", testJpaAutomationComposition.getName());
+        assertEquals("automation-composition", jpaAutomationComposition.getName());
         assertEquals("automation-composition",
                 new JpaAutomationComposition(createAutomationCompositionInstance()).getName());
 
-        var testJpaAutomationComposition2 = new JpaAutomationComposition(testJpaAutomationComposition);
-        assertEquals(testJpaAutomationComposition, testJpaAutomationComposition2);
+        var jpaAutomationComposition2 = new JpaAutomationComposition(jpaAutomationComposition);
+        assertEquals(jpaAutomationComposition, jpaAutomationComposition2);
     }
 
     @Test
@@ -130,60 +135,65 @@
 
     @Test
     void testJpaAutomationCompositionCompareTo() {
-        var testJpaAutomationComposition = createJpaAutomationCompositionInstance();
+        var jpaAutomationComposition = createJpaAutomationCompositionInstance();
 
-        var otherJpaAutomationComposition = new JpaAutomationComposition(testJpaAutomationComposition);
-        assertEquals(0, testJpaAutomationComposition.compareTo(otherJpaAutomationComposition));
-        assertEquals(-1, testJpaAutomationComposition.compareTo(null));
-        assertEquals(0, testJpaAutomationComposition.compareTo(testJpaAutomationComposition));
-        assertNotEquals(0, testJpaAutomationComposition.compareTo(new DummyJpaAutomationCompositionChild()));
+        var otherJpaAutomationComposition = new JpaAutomationComposition(jpaAutomationComposition);
+        assertEquals(0, jpaAutomationComposition.compareTo(otherJpaAutomationComposition));
+        assertEquals(-1, jpaAutomationComposition.compareTo(null));
+        assertEquals(0, jpaAutomationComposition.compareTo(jpaAutomationComposition));
+        assertNotEquals(0, jpaAutomationComposition.compareTo(new DummyJpaAutomationCompositionChild()));
 
-        testJpaAutomationComposition.setInstanceId("BadValue");
-        assertNotEquals(0, testJpaAutomationComposition.compareTo(otherJpaAutomationComposition));
-        testJpaAutomationComposition.setInstanceId(INSTANCE_ID);
-        assertEquals(0, testJpaAutomationComposition.compareTo(otherJpaAutomationComposition));
+        jpaAutomationComposition.setInstanceId("BadValue");
+        assertNotEquals(0, jpaAutomationComposition.compareTo(otherJpaAutomationComposition));
+        jpaAutomationComposition.setInstanceId(INSTANCE_ID);
+        assertEquals(0, jpaAutomationComposition.compareTo(otherJpaAutomationComposition));
 
-        testJpaAutomationComposition.setCompositionId(UUID.randomUUID().toString());
-        assertNotEquals(0, testJpaAutomationComposition.compareTo(otherJpaAutomationComposition));
-        testJpaAutomationComposition.setCompositionId(COMPOSITION_ID);
-        assertEquals(0, testJpaAutomationComposition.compareTo(otherJpaAutomationComposition));
+        jpaAutomationComposition.setCompositionId(UUID.randomUUID().toString());
+        assertNotEquals(0, jpaAutomationComposition.compareTo(otherJpaAutomationComposition));
+        jpaAutomationComposition.setCompositionId(COMPOSITION_ID);
+        assertEquals(0, jpaAutomationComposition.compareTo(otherJpaAutomationComposition));
 
-        testJpaAutomationComposition.setName("BadValue");
-        assertNotEquals(0, testJpaAutomationComposition.compareTo(otherJpaAutomationComposition));
-        testJpaAutomationComposition.setName("automation-composition");
-        assertEquals(0, testJpaAutomationComposition.compareTo(otherJpaAutomationComposition));
+        jpaAutomationComposition.setCompositionTargetId(UUID.randomUUID().toString());
+        assertNotEquals(0, jpaAutomationComposition.compareTo(otherJpaAutomationComposition));
+        jpaAutomationComposition.setCompositionTargetId(null);
+        assertEquals(0, jpaAutomationComposition.compareTo(otherJpaAutomationComposition));
 
-        testJpaAutomationComposition.setVersion("0.0.0");
-        assertNotEquals(0, testJpaAutomationComposition.compareTo(otherJpaAutomationComposition));
-        testJpaAutomationComposition.setVersion("0.0.1");
-        assertEquals(0, testJpaAutomationComposition.compareTo(otherJpaAutomationComposition));
+        jpaAutomationComposition.setName("BadValue");
+        assertNotEquals(0, jpaAutomationComposition.compareTo(otherJpaAutomationComposition));
+        jpaAutomationComposition.setName("automation-composition");
+        assertEquals(0, jpaAutomationComposition.compareTo(otherJpaAutomationComposition));
 
-        testJpaAutomationComposition.setDeployState(DeployState.DEPLOYED);
-        assertNotEquals(0, testJpaAutomationComposition.compareTo(otherJpaAutomationComposition));
-        testJpaAutomationComposition.setDeployState(DeployState.UNDEPLOYED);
-        assertEquals(0, testJpaAutomationComposition.compareTo(otherJpaAutomationComposition));
+        jpaAutomationComposition.setVersion("0.0.0");
+        assertNotEquals(0, jpaAutomationComposition.compareTo(otherJpaAutomationComposition));
+        jpaAutomationComposition.setVersion("0.0.1");
+        assertEquals(0, jpaAutomationComposition.compareTo(otherJpaAutomationComposition));
 
-        testJpaAutomationComposition.setLockState(LockState.UNLOCKED);
-        assertNotEquals(0, testJpaAutomationComposition.compareTo(otherJpaAutomationComposition));
-        testJpaAutomationComposition.setLockState(LockState.NONE);
-        assertEquals(0, testJpaAutomationComposition.compareTo(otherJpaAutomationComposition));
+        jpaAutomationComposition.setDeployState(DeployState.DEPLOYED);
+        assertNotEquals(0, jpaAutomationComposition.compareTo(otherJpaAutomationComposition));
+        jpaAutomationComposition.setDeployState(DeployState.UNDEPLOYED);
+        assertEquals(0, jpaAutomationComposition.compareTo(otherJpaAutomationComposition));
 
-        testJpaAutomationComposition.setDescription("A description");
-        assertNotEquals(0, testJpaAutomationComposition.compareTo(otherJpaAutomationComposition));
-        testJpaAutomationComposition.setDescription(null);
-        assertEquals(0, testJpaAutomationComposition.compareTo(otherJpaAutomationComposition));
+        jpaAutomationComposition.setLockState(LockState.UNLOCKED);
+        assertNotEquals(0, jpaAutomationComposition.compareTo(otherJpaAutomationComposition));
+        jpaAutomationComposition.setLockState(LockState.NONE);
+        assertEquals(0, jpaAutomationComposition.compareTo(otherJpaAutomationComposition));
 
-        testJpaAutomationComposition.setRestarting(true);
-        assertNotEquals(0, testJpaAutomationComposition.compareTo(otherJpaAutomationComposition));
-        testJpaAutomationComposition.setRestarting(null);
-        assertEquals(0, testJpaAutomationComposition.compareTo(otherJpaAutomationComposition));
+        jpaAutomationComposition.setDescription("A description");
+        assertNotEquals(0, jpaAutomationComposition.compareTo(otherJpaAutomationComposition));
+        jpaAutomationComposition.setDescription(null);
+        assertEquals(0, jpaAutomationComposition.compareTo(otherJpaAutomationComposition));
 
-        testJpaAutomationComposition.setStateChangeResult(StateChangeResult.NO_ERROR);
-        assertNotEquals(0, testJpaAutomationComposition.compareTo(otherJpaAutomationComposition));
-        testJpaAutomationComposition.setStateChangeResult(null);
-        assertEquals(0, testJpaAutomationComposition.compareTo(otherJpaAutomationComposition));
+        jpaAutomationComposition.setRestarting(true);
+        assertNotEquals(0, jpaAutomationComposition.compareTo(otherJpaAutomationComposition));
+        jpaAutomationComposition.setRestarting(null);
+        assertEquals(0, jpaAutomationComposition.compareTo(otherJpaAutomationComposition));
 
-        assertEquals(testJpaAutomationComposition, new JpaAutomationComposition(testJpaAutomationComposition));
+        jpaAutomationComposition.setStateChangeResult(StateChangeResult.NO_ERROR);
+        assertNotEquals(0, jpaAutomationComposition.compareTo(otherJpaAutomationComposition));
+        jpaAutomationComposition.setStateChangeResult(null);
+        assertEquals(0, jpaAutomationComposition.compareTo(otherJpaAutomationComposition));
+
+        assertEquals(jpaAutomationComposition, new JpaAutomationComposition(jpaAutomationComposition));
     }
 
     @Test
diff --git a/models/src/test/java/org/onap/policy/clamp/models/acm/utils/AcmUtilsTest.java b/models/src/test/java/org/onap/policy/clamp/models/acm/utils/AcmUtilsTest.java
old mode 100644
new mode 100755
index a9bd25f..e0e5a2e
--- a/models/src/test/java/org/onap/policy/clamp/models/acm/utils/AcmUtilsTest.java
+++ b/models/src/test/java/org/onap/policy/clamp/models/acm/utils/AcmUtilsTest.java
@@ -68,6 +68,7 @@
         assertThat(AcmUtils.isInTransitionalState(DeployState.DEPLOYED, LockState.UNLOCKING)).isTrue();
         assertThat(AcmUtils.isInTransitionalState(DeployState.DELETING, LockState.NONE)).isTrue();
         assertThat(AcmUtils.isInTransitionalState(DeployState.UPDATING, LockState.LOCKED)).isTrue();
+        assertThat(AcmUtils.isInTransitionalState(DeployState.MIGRATING, LockState.LOCKED)).isTrue();
     }
 
     @Test
@@ -195,6 +196,18 @@
     }
 
     @Test
+    void testCreateAcElementDeployList() {
+        var automationComposition = getDummyAutomationComposition();
+        var result = AcmUtils.createParticipantDeployList(automationComposition, DeployOrder.DEPLOY);
+        assertThat(result).hasSameSizeAs(automationComposition.getElements().values());
+        for (var participantDeploy : result) {
+            for (var element : participantDeploy.getAcElementList()) {
+                assertEquals(DeployOrder.DEPLOY, element.getOrderedState());
+            }
+        }
+    }
+
+    @Test
     void testCreateAcElementRestart() {
         var element = getDummyAutomationComposition().getElements().values().iterator().next();
         var result = AcmUtils.createAcElementRestart(element);
@@ -210,8 +223,8 @@
         Map<UUID, AutomationCompositionElement> map = new LinkedHashMap<>();
         try {
             var element = new StandardCoder().decode(
-                new File("src/test/resources/json/AutomationCompositionElementNoOrderedState.json"),
-                AutomationCompositionElement.class);
+                    new File("src/test/resources/json/AutomationCompositionElementNoOrderedState.json"),
+                    AutomationCompositionElement.class);
             map.put(UUID.randomUUID(), element);
         } catch (Exception e) {
             fail("Cannot read or decode " + e.getMessage());
