Results 1 to 10 of 10

Thread: Question related to importing data from old sql server db

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Question related to importing data from old sql server db

    I had on an older system a SQL Server db for a customer project. That PC has since been retired. I still have the hdd that holds all the files but not the rest of the hardware so booting it up and loading SQL server to detach or export the data is not really an option.

    Ideally I would like to be able to move the DB to a newer system as easily as possible but not sure that is possible given the db was not detached.

    The old db was created with I think SQL Server 6.5
    I would like to be able to bring it into SQL Server Express 2012.

    I do have the script files that build the db structure but the data is another story.

    Alternately I may be able to remote into the customers system, detach their copies of the db and then make a copy and re-attach.

    Any advice?

  2. #2
    Frenzied Member
    Join Date
    May 2014
    Location
    Central Europe
    Posts
    1,372

    Re: Question related to importing data from old sql server db

    i think it should be possible to restore a .bak file from SQL Server 6.5 in later SQL Server versions. if you can only get the .mdf and .log files (assuming 6.5 had those?!) you will probably need a 6.5 installation to attach them.

  3. #3
    Superbly Moderated NeedSomeAnswers's Avatar
    Join Date
    Jun 2002
    Location
    Manchester uk
    Posts
    2,660

    Re: Question related to importing data from old sql server db

    i think it should be possible to restore a .bak file from SQL Server 6.5
    If you dont have a .bak file but you do have the .mdf & ldf files then if you have the same version of SQL server installed you maybe able to just reattach them to your new instance.

    example script below

    Code:
    USE master;  
    GO  
    CREATE DATABASE mydb
        ON (FILENAME = 'C:\myfiles\mydb_Data.mdf'),  
        (FILENAME = 'C:\myfiles\mydb_Log.ldf')  
        FOR ATTACH;  
    GO
    Please Mark your Thread "Resolved", if the query is solved & Rate those who have helped you



  4. #4

    Thread Starter
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: Question related to importing data from old sql server db

    I do not have the old versions installed at this time. I'm not sure it will install on Win7 and know it will not on Win10.
    The code and the db was originally written on an XP machine. I have the hdd in a dock and it has the mdf and ldf files on it.

    Now that I think about it I do have a VM that I created from one of my older XP dev boxes. It may very well have the older version of SQL Server on it. I will have to boot it up and see.

  5. #5
    A SQL Server fool GaryMazzone's Avatar
    Join Date
    Aug 2005
    Location
    Dover,NH
    Posts
    7,495

    Re: Question related to importing data from old sql server db

    If it is 6.5 I do not think you can import directly to 2012 (even with a .bak). you would need at least one version between them (it might import to a 2005) then from there to 2012
    Sometimes the Programmer
    Sometimes the DBA

    Mazz1

  6. #6

    Thread Starter
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: Question related to importing data from old sql server db

    I'm not totally sure that it is 6.5 it might be Sql Server 2000 but definitely no later than that.
    I know for sure that whatever version it was it still used the enterprise manager program.

    Edit:
    So I loaded up my VM and it looks like it is SQl Server 8 so I assume that must be SQL Server 2000.

    I do not have time right now to try it but will try to get the files onto the vm later and see if I have any luck.
    Last edited by DataMiser; Nov 18th, 2019 at 11:43 AM.

  7. #7
    A SQL Server fool GaryMazzone's Avatar
    Join Date
    Aug 2005
    Location
    Dover,NH
    Posts
    7,495

    Re: Question related to importing data from old sql server db

    Still might have problems going 2000 to 2012... I'm not sure that even imports to 2008R2. still might need to update to 2005 and then to 2012
    Sometimes the Programmer
    Sometimes the DBA

    Mazz1

  8. #8
    A SQL Server fool GaryMazzone's Avatar
    Join Date
    Aug 2005
    Location
    Dover,NH
    Posts
    7,495

    Re: Question related to importing data from old sql server db

    Version numbers for SQL Server
    6.5 SQL Server 6.5
    7.0 SQL Server 7
    8.0 SQL Server 2000
    9.0 SQL Server 2005
    10.0 SQL Server 2008
    10.5 SQL Server 2008R2
    11.0 SQL Server 2012
    12.0 SQL Server 2014
    13.0 SQL Server 2016
    14.0 SQL Server 2017
    15.0 SQL Server 2019
    Sometimes the Programmer
    Sometimes the DBA

    Mazz1

  9. #9

    Thread Starter
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: Question related to importing data from old sql server db

    Thanks for the info.

    I will try it when I get a chance just to see if it works as I am curious now.

    I have decided that for the project I am going to pull the data directly from the customers systems since I know that will work and would be better to have more current data anyway.
    Now I am waiting for them to give the ok on the project before I spend any more of my time on it.

  10. #10
    Wall Poster TysonLPrice's Avatar
    Join Date
    Sep 2002
    Location
    Columbus, Ohio
    Posts
    3,834

    Re: Question related to importing data from old sql server db

    Quote Originally Posted by GaryMazzone View Post
    Still might have problems going 2000 to 2012... I'm not sure that even imports to 2008R2. still might need to update to 2005 and then to 2012
    We made that jump not that long ago...there was quite a bit of deprecated T-SQL we had to convert. I know that is different from the data but just FYI.
    Please remember next time...elections matter!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width