-
Nov 16th, 2019, 06:18 PM
#1
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?
-
Nov 17th, 2019, 05:08 AM
#2
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.
-
Nov 18th, 2019, 04:18 AM
#3
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
-
Nov 18th, 2019, 07:53 AM
#4
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.
-
Nov 18th, 2019, 08:00 AM
#5
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
-
Nov 18th, 2019, 11:19 AM
#6
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.
-
Nov 18th, 2019, 12:42 PM
#7
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
-
Nov 18th, 2019, 12:47 PM
#8
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
-
Nov 18th, 2019, 01:56 PM
#9
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.
-
Nov 18th, 2019, 02:56 PM
#10
Re: Question related to importing data from old sql server db
Originally Posted by GaryMazzone
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|