Base solution for your next web application
Open Closed

Update existing Project to new AspNet Zero release #9364


User avatar
0
geoteam created

Hi, I tried to update an exiting project to an new release of AspNet Zero as described in your docu under Common->Other->Version Upgrade. I stuck on the point "copy your exisitng project's source code to migrate branche".

How should I copy my code to the migrate branch? In the explorer from the backupfolder of my existing code to the folder where the newly created AspNet Zero project is created, somehow in VS or from explorer to VS-Window?

What should I copy? The complet project folder under repros or for example only css, cshtm, cs... files without for example github-files?

After copying my existing project from base folder over the new created AspNet Zero folder switched to migrate branch before, I get an error from Github like "sh an das Remoterepository: rejected Updates were rejected because the tip of your current branch is behind its remote counterpart. Integrate the remote changes before pushing again.."

Can you explain the part "Copy your existing project's source code to migrate branch" in more detail?

What I have done so far:

  1. Downloaded my initial version of AspNet Zero and create a runable project (as described in getting started).
  2. Pushed this project to a new github repository (as master).
  3. Created the branches dev from master and migrate and aspnetzero from dev.

Kind regards, Frank


6 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @geoteam

    You must delete all the content in Migrate branch and copy your existing source code which you already developed until now to this Migrate branch.

  • User Avatar
    0
    geoteam created

    Hi ismcagdas, how and where is the content deleted from the migrate branch? Delete the entire content of the project directory in the file system while Visual Studio is open and the migrate branch is active?

    I think my mistake was that the existing project was already connected to git and I copied the .git folder and everything else into the migrate branch.

    Now I did the following:

    • created master branch from a new aspnet zero project with the correct version
    • created aspnetzero and migrate branch from the dev branch
    • set migrate branch to active in Visual Studio
    • copy the entire project directory in file system (except the .git folder) of the existing code from a backup to the current project directory while Visual Studio is open and the migrate branch is active.
    • merge migrate to dev branch
    • created a new project with the current ASPnet zero version and made it executable.
    • activate the aspnetzero branch
    • copy the complete project directory of the new AspNet Zero project in the file system to the current project directory while Visual Studio is open and the aspnetzero branch is active.
    • merge aspnetzero into dev and fix the error.

    Is this way correct? At the moment everything looks fine, but I'm wondering if this might cause a lot of unused files from old versions to be in the project over time.

    I know it's a lot of repetition from the documentation, but it's a big and important step to do the upgrade to new and future versions correctly.

    Thanks and best regards Frank

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @geoteam,

    Yes, that's correct but when you switch to AspNet Zero branch, first delete all files and then copy the complete project directory of the new AspNet Zero project to the current project directory while Visual Studio is open and the aspnetzero branch is active.

    In this way, the deleted files will be deleted from development branches.

  • User Avatar
    0
    geoteam created

    Hi ismcagdas, thank you very much, it worked.

    One last question. I now have the "new project" structure. At the end of the section in the documentation it says that the aspnetzero branch should now always be overwritten only with the current AspNet Zero version. In the last post you recommend to delete the files in the aspnetzero branch before updating. What is the best way? Many greetings Frank

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @geoteam

    First deleting all files and then copying the content to aspnetzero branch is better since it will delete not used files.

  • User Avatar
    0
    geoteam created

    Hi ismcagdas, ok thank you very much. I will do this the next time I upgrade AspNet Zero. Best regards Frank