Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Peter Kongyik 28 posts 170 karma points
    Nov 05, 2015 @ 12:06
    Peter Kongyik
    0

    Database migration in the background without starting the site - is this possible?

    Hey everyone!

    I just got my umbraco projected upgraded from 7.2.4 to 7.3.1. I did this with using nuget (for /bin, /umbraco, /umbraco_client folders and config files) then with starting my site which triggered migrating the database. As it as stated here. Cool, this perfectly works.

    My question is that is there a way to run the database migration without starting the site? I mean is there any tool out there that can achieve this in the background? If not how can I mimic this? I have a live site which I want to upgrade silently.

    I've noticed in the source code that the logic for migration is under

        Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenThreeOne
    

    and several other namespaces. Should I create a little utility that would execute these "MigrationBase" classes in the right order, from 7.2.5 all the way to 7.3.1?

    The reason I'm asking this is because I had to make some modifications in my code in order for the migration to start (page was not willing to come in due to I used the UmbracoHelper before the migration could ran and of course my dlls were already updated). I'd like to avoid making these modifications and reverting it after the migration had executed.

    thanks in advance, Peter

  • Peter Kongyik 28 posts 170 karma points
    Nov 24, 2015 @ 11:46
    Peter Kongyik
    100

    I'm gonna answer my own question :), it seems there is a way to upgrade automatically behind the scenes without starting the site:

    Umbraco.Core.Persistence.Migrations.MigrationRunner.Execute
    
Please Sign in or register to post replies

Write your reply to:

Draft