# Migrating an existing Vidyano v5 project

Because Vidyano v6 uses ASP.NET Core and EntityFrameworkCore most migrating steps are related to this (and any online tutorial for upgrading to ASP.NET Core will help in this step). Below are the general steps needed to get you up and running.

* Create a new project using the above steps (this will create a correct project for .NET core and the correct startup logic)
* As with most tutorials, it is now time to copy over the existing code you had (.NET core no longer has the path of different files inside your .csproj file so you can just copy them over folder wise)
* Service goes to Service folder, static webrelated files for to wwwroot, App\_Data goes to wwwroot/App\_Data
* A few exceptions are needed, for the \*Advanced/\*AuthenticatorService/\*BusinessRules/\*Queries/\*Web it is best to copy the methods/properties/fields in the existing classes where possible
* Any existing NuGet references that the application had will need to be added again (as PackageReference, the packages.json is no longer valid)
* Any appSettings/connectionStrings from web.config need to be copied over in the appsettings.json file, Vidyano.X settings go inside the Vidyano object (\<add key="Vidyano.X" value="True" /> becomes {"Vidyano":{"X": true}})
* Vidyano v6 (and .NET Core/ASP .NET Core) makes great use of DI, that's why all PersistentObjectActions implementation now require a default constructor that at least excepts the TContext as a parameter, other services can now be constructor injected there as well.
* Your existing EntityFramework DbContext needs to be upgraded to EntityFrameworkCore. Some notable/recommended changes
  * Make sure properties are virtual (the Proxy package is included but needs to be enabled manually)
  * Mark InverseProperties where needed
  * Mark ForeignKey where needed
  * Mark classes with Table attribute
  * Remove Index attribute (needs to be configured in OnModelCreating)
* You existing \*Web also needs some updates, ASP.NET Core no longer uses HttpResponseMessage so all custom api methods needs to be updated to use IActionResult as return type (that exact type).
* \*Advanced also has most breaking changes (deprecated code has been dropped, ...)
