November Happy Hour will be moved to Thursday December 5th.

Testing (re running) migration steps

Vote:
 

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 ;)

#230227
Nov 02, 2020 8:27
Vote:
 

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.

#230228
Nov 02, 2020 9:05
Vote:
 

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.

#230229
Nov 02, 2020 10:46
Vote:
 

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

#230230
Nov 02, 2020 10:52
Vote:
 

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?

#230231
Nov 02, 2020 11:22
Vote:
 

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

#230232
Nov 02, 2020 11:28
Vote:
 

Thank you very much Quan

#230242
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.