locked
Need help in how to handle an unexpected upgrade to my VS files RRS feed

  • Question

  • User259881276 posted

    I developed my VS web in 2009 with VS 2008. Couple of years ago, I needed to do some changes and lost some files due to windows update & reformat. I had some old back up copies of my site. Somewhere in the process of all this Visual Studio upgraded my VS 2008 to VS 2019.. It upgraded my web forms. Then it would not work with my database because of an error re: SQL Server, (I don't now remember what version of SQL Server I had created my site with). I tried upgrading the SQL server and just kept getting errors. I then tried uninstalling VS 2019 to go back to my original version but the 2019 changed the web file I was working on. Even my backup files were also changed and they weren't even opened and I did not try to upgrade them.  I did not realize this upgrade was irreversible!

    So now my question is, with all this stuff going on, what is simplest way to get my old files working again since the 2008 code worked fine but the 2019 doesn't (it shows ton of errors) and I ended up uninstalling all the SQL servers because of not know which one I needed. I have downloaded my original website from my host. (The whole thing is 5 gigs for some reason so must also include a SQL Server database. I also downloaded just my web Files and the DB the site is using. That was about 40 MB)

    I want to get back to the old 2008 version. How can I do that? And how do I know which SQL server I can use? I have my VS 2008 disc and it included SQL server 2005 developer edition but someone mentioned somewhere that new windows 10 may not work with that old SQL version.

    How should I proceed? I am not a professional developer. Just trying to  maintain my little business website myself. I can no longer make changes on it like adding reCaptcha, updating my old info, etc. Spammers have rendered the website useless since I don't have time to sort real mail from spam mail.  I really hate after all the time I put into developing that site, to have to scrub it all and make a new one with another product just to be able to make changes. Hope someone has the time & knowledge to help guide me what the best way forward is in all this.

    If my post needs to be moved somewhere else, please let me know. Thank you in advance.

    I have a copy of my website and am trying to use VS 2008 to view, changes, etc.

    When I tried to attach database, I got this error:

    The database 'C:\MYWEBSITE_LOCALCOPY\APP_DATA\USADB.MDF' cannot be opened because it is version 869. This server supports version 612 and earlier. A downgrade path is not supported.

    Could not open new database 'C:\MYWEBSITE_LOCALCOPY\APP_DATA\USADB.MDF'. CREATE DATABASE is aborted. (.Net SqlClient Data Provider)

    Monday, March 22, 2021 11:38 PM

All replies

  • User-939850651 posted

    Hi RaeKC,

    I want to get back to the old 2008 version. How can I do that? And how do I know which SQL server I can use? I have my VS 2008 disc and it included SQL server 2005 developer edition but someone mentioned somewhere that new windows 10 may not work with that old SQL version.

    In fact, once the database is upgraded, it cannot be downgraded. It looks like your MDF has been upgraded to version 869, which corresponds to the SQL Server 2017 version. If you need to go back to SQL Server 2005 for deployment, you must also develop on SQL Server 2005.

    You can attach the created MDF to SQL Server 2017, write a script of the database content, and then import the script into the correct version of the SQL Server 2005 database.

    For more details, you could refer to these link below:

    https://stackoverflow.com/questions/1892313/sql-server-version-612-655

    SQL Database downgrade internal version and Compatibility Level

    Best regards,

    Xudong Peng

    Tuesday, March 23, 2021 6:33 AM
  • User259881276 posted

    Thank you. I just found out that my backup is also a VS 2019. Apparently I managed to upload that version in 2019. So I'm going to have to stay with 2019 and download SQL server 2017.

    Does that version number "869" indicate which SQLserver version was used? I don't remember since they were uninstalled and I don't know if I need to download SQLEXPR or SqlLocalDB ?

    Thanks so much for your help.

    Tuesday, March 23, 2021 4:03 PM
  • User259881276 posted

    How do I create a new database in SQL 2017 so I can work with VS 2019? Is there a way to use my last database in that ? Or do I have to start from beginning?

    Wednesday, March 24, 2021 12:34 AM
  • User-939850651 posted

    Hi ReaKC,

    The version number "869" means to use sql server 2017, which is mentioned in the link I gave before, you can refer to it.

    If you need to manually restore the database using MDF and LDF files, you could use SSMS or T-SQL to do so.

    Method 1. Using SQL Server Management Studio

    1. Open SSMS and go to "Object Explorer".
    2. Right-click the database you need to restore and select "Attach". Click the "Add" button when "Attach Database" Windows appears.
    3. Browse the location of MDF file and select it. Then, click "OK". And SQL Server Management Studio will restore the database from the MDF file.

    Method 2. Using T-SQL

    Login to SQL Server database, go to New Query Window and run the following T-SQL script to attach MDF file in SQL Server.

    Create database dbname
    On
    (
       Filename= 'path where you copied files',
       Filename ='path where you copied log'
    )
    For attach;

    You could also refer to this article:

    https://www.easeus.com/sql-database-recovery/restore-database-from-mdf-and-ldf-files-in-sql-server.html

    Best regards,

    Xudong Peng

    Thursday, March 25, 2021 9:22 AM
  • User259881276 posted

    Thank you. I had done this last night as I realized I already had SSMS v. 18 and SQL server 2017. I have so many old non working copies of my old VS file, I wasn't sure which one would work. I had previously downloaded my web from my host. I went into that folder and made a copy of only the App_data folder to a new test folder which contained only that app-data folder. I then tried attaching database in that new test folder  to SSMS and instead of opening that database in that new test folder, it automatically pointed to the folder where I had apparently originally built my web - one of my copies of last working file I used (with VS 2019). That was the file that has my last uploaded copy.

    Problem is, before I uploaded that project, I had precompiled it as I always make a precompiled folder with same name so have two folders with same name except one says precompiled at end of file name. I don't mess with the precompiled one. But that working copy which SSMS is pointing to, does not contain a SLN. ! It has all the files but no solution file. When I tried opening with VS,  it detected a Web.csproj project and gave a warning about making changes to the project if I continue so I clicked no and closed. I didn't want to make another irreversible mistake before I was sure what I was about to do. The odd thing is that the precompiled folder does contain a .SLN for that web. I am not sure what occurred in past and how or why that folder has no solution but the precompiled one does. When it precompiles, it also makes the .sln in the precompile folder .  Its been a couple of years and I forgot how I did this. But I don't understand where the .SLN is for that web file in my local working copy.

    thank you AGAIN for your help!

    Thursday, March 25, 2021 2:55 PM
  • User259881276 posted

    Thank you .  I had done that before but now have done this again more carefully.

    Here are steps I took:  I first opened SSMS as administrator, connected to the SQL Server 2017 and my databases I had attached were still attached there. I then opened my Visual Studio 2019 file that I want to work with (opened as administrator).

    In the server server object explorer view, it displays my 2017 SQL server and all the databases attached to it including the one for this VS file. It will let me look at my tables, etc. So that's all good.

    I can also open any page in that VS file and preview it in the browser. Also good. So I can preview any changes, etc.

    However, I cannot publish it. When I click on the Build menu, it only has a few options: build, rebuild and clean options. Nothing else. When I click any of that, it just states saved in lower part of my screen. It does not seem to go through the rebuild web process. It doesn't have an option to build solution or rebuild solution.  And it has no publish option.

    I can work all I want in this file and view and test changes in the browser but I can't seem to make a solution or publish. I don't understand what I have done wrong or need to do.

    Friday, March 26, 2021 1:08 PM