Testing (re running) migration steps


Hi all, 

What is the best approach to test the IMigrationStep in order to run it multiple times on our local development environment?

I have a migration step that will create new tables and stored procedures on the CMS database on a new schema. I have been able to re run it again by delete the row on tblBigTable that has the storename column with the name of the migration step assembly.

Is this correct?

Many thanks in advance ;)

Nov 02, 2020 8:27

I assume you are referring to IMigrationStep in EPiServer.Commerce.Internal.Migration.Steps?

It's an internal interface so support is limited (i.e. there is no way to retry). But you can workaround by return false for Execute step regardless of the result. You can then rerun it until you are happy.

Nov 02, 2020 9:05

Hi Quan, thanks a lot for the fast help. 

So, if on the first time it returned true, it will no long run again, correct?

My ideia, was if returned true on first time, i could rerun again.

Nov 02, 2020 10:46

yes if it returned true it's not run again. the idea of the migration steps are they run once. For testing purpose, you can simply return false to be able to rerun

Nov 02, 2020 10:52

In my case, i did already run a step that returned true. so if i want to rerun because it's still on develop and forgot to return false, i restore the database or i could delete the entry on tblBigTable that mention that step. or i shall not delete at all that row?

Nov 02, 2020 11:22

You can delete the row and restart the site to clear cache. Of course that is strictly "experimental only".

Nov 02, 2020 11:28

Thank you very much Quan

Nov 02, 2020 14:23
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.