Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document migration failure condition & method for fixing #1

Open
katerd opened this issue Jan 12, 2015 · 6 comments
Open

Document migration failure condition & method for fixing #1

katerd opened this issue Jan 12, 2015 · 6 comments

Comments

@katerd
Copy link
Contributor

katerd commented Jan 12, 2015

No description provided.

@Myster
Copy link

Myster commented Feb 25, 2015

+1 I also can't find out why a migration failed. I just see 0 completed column in the db

@katerd
Copy link
Contributor Author

katerd commented Feb 25, 2015

Do you see any uFluent lines in the UmbracoTraceLog.txt file inside ~/App_Data/Logs/ ? It should start something like this:

2015-02-25 09:27:43,904 [19] DEBUG uFluent.Migrate.MigrationProcessor - uFluent.Migrate started
2015-02-25 09:27:43,919 [19] DEBUG uFluent.Migrate.Persistence.TableFactory - MigrationHistory table already exists.
2015-02-25 09:27:44,396 [19] DEBUG uFluent.Migrate.MigrationProcessor - Found 251 migrations
2015-02-25 09:27:44,396 [19] DEBUG uFluent.Migrate.MigrationProcessor - Starting migrations.
2015-02-25 09:27:44,402 [19] DEBUG uFluent.Migrate.Persistence.DatabaseUtil - HasMigrationExecuted for Initial is True

@Myster
Copy link

Myster commented Feb 25, 2015

No, but now I do, and can't reproduce it not happening.

@tgriley
Copy link
Contributor

tgriley commented Feb 25, 2015

You'll need to delete that row in the DB otherwise it wont attempt to run the migration again.

@Myster
Copy link

Myster commented Mar 1, 2015

Is there an easier way to re-run a failed migration? as that workflow for my dev environment seems a bit clunky?

@tgriley
Copy link
Contributor

tgriley commented Mar 8, 2015

Sorry for the late reply! I've been on holiday. If the migration failed you have to delete the row in the database for the migration. If it has ran 'successfully' but didn't do what you wanted you should do a db restore, but this is rare. We purposely made it slam on the brakes and rollback if anything isn't as expected to ensure nothing can have an adverse effect on our production environment, without this confidence automatic migrations would be a scary business!
Our workflow over the last 250+ migrations has been create db backup, run migration, then one of the following;

  • DB indicates success & expected outcome - jobs a good'n, move on.
  • DB indicates failure - check log, modify migration, delete row in migration history table.
  • DB indicates success & unexpected outcome - workout what went wrong, do a db restore, modify migration and try again.

The latter has never happened anywhere other than our local dev environments. This is mainly because we follow this workflow, we are 100% confident the migrations that run in test/prod are exactly the same as the ones that executed successfully locally.

I totally agree that this adds a little extra effort in dev over a traditional approach, but we have found the advantages far outweigh the disadvantages. We do have plans in future to have a dash in the umbraco back end as you suggested but this will come after the fluent api is 'feature complete'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants