Base solution for your next web application
Open Closed

Migrator running on production server #7124


User avatar
0
nicolaslau created

i will use migrator to update my database.when i copy the compiled migrator folder, and run it. i get error missing many dependencies from Migrator.deps.json. i try copy all my dlls from web project. i still get error 'SqlClient.dll version 4.6.0' not found, actually it has a SqlClient.dll with version 4.6.27110.4.

what is the correct process to upgrade/create databse using Migrator in production enviorment?


3 Answer(s)
  • User Avatar
    1
    maliming created
    Support Team

    Try the dotnet publish command

    >\MyCompanyName.AbpZeroTemplate.Migrator> dotnet publish -c Release -r win-x64 --self-contained
    

    Then copy all files in the publish directory

    and https://docs.aspnetzero.com/documents/aspnet-core-angular/latest/Migrator-Console-Application

  • User Avatar
    0
    nicolaslau created

    @maliming it works. do i need to rebuild the migrator every other source codes(like web) changed? or just copy only my project updated dll(not migrator) to this dir ?

  • User Avatar
    1
    maliming created
    Support Team

    XXX.Migrator only depends on the XXX.EntityFrameworkCore project. So in general you don't need to rebuild.

    You need to rebuild Migrator project when needed instead of copying other dll files.