Solved

Migrate SQL Sever 2000 bak file to SQL server 2005

Posted on 2009-06-29
11
580 Views
Last Modified: 2012-05-07
Hi all,
    I have been busy getting my new servers up and running and ran into a small problem.
    My current databases are in SQL Server 2000 and on servers in Virginia that I access remotely.  They are fully functional and backed up every night.
    My new database servers are in Texas and running SQL Server 2005 that I access remotely.  
    Here is the problem.  The databases are about 1G apiece and I tried scripting the entire database in SQL Server 2000 and running in the 2005 but there were some errors in some of the scripts.  
    So next I ftped the bak file from the 2000 machine to the 2005 machine.  

    I tried to restore, but I get an error as soon as I try, The backup set holds a backup of a database other than the existing database name here database.

    I also tried restore files or file groups and got the same error.  

   How can I take the bak file from 2000 and get it running under 2005?  Is there a better way to go about this?

    I already copied the logins from 2000 to 2005.  I found a white paper from Microsoft that helped migrate all the user names.

    If I create a script in 2000 for each type of database objects, that seems to work, but it iis very slow and doesn't get the data from 2000 to 2005.  Thoughts?

    I have been googling for solutions and they say to use the bak fille, but it doesn't seem to work for me.  I am at a loss and am turning to EE.

Thanks,
Mike
0
Comment
Question by:Data-Man
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 2
11 Comments
 
LVL 15

Expert Comment

by:mohan_sekar
ID: 24737322
What error do you get while trying to restore the .BAK file?
0
 
LVL 15

Expert Comment

by:mohan_sekar
ID: 24737337
0
 
LVL 18

Author Comment

by:Data-Man
ID: 24737346
It says,

The backup set holds a backup of a database other than the existing database name here database.

Makes me think that since the bak file came from a SS 2000 database and I'm trying to restore it to SS 2005 it doesn't like it.

Mike
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 23

Accepted Solution

by:
Racim BOUDJAKDJI earned 250 total points
ID: 24737356
<<  I tried to restore, but I get an error as soon as I try, The backup set holds a backup of a database other than the existing database name here database.

    I also tried restore files or file groups and got the same error.  >>
There are usually no issues restoring a SQL2000 backup on q SQL2005 engine.
Looks like you simply need to restore with a different name and different location.

Simply run this in command line

restore filelistonly from disk = '<put the complete backup  file path here>'

this will return the logical file names of the source database ...Note the logical file names and their complete pathes..Once you are done, simply run

restore database <put the new name here> from disk = '<put the complete backup file path here>'
with
move '<put the logical data file name here you did get from the previous execution>' to '<put the complete file path where you want to store the data file>',
move '<put the logical log file name here you did get from the previous execution>' to '<put the complete file path where you want to store the log file>', replace

That should do the trick...

HTH
0
 
LVL 18

Author Comment

by:Data-Man
ID: 24737458
Running the script now....no errors and 2 minutes into it.  wooohoo!!!!!!!

Will let you know if it works.

Thanks,
Mike
0
 
LVL 18

Author Comment

by:Data-Man
ID: 24737489
Racimo,
    Worked perfectly.  I should have know to fall back to T-SQL instead of relying on the wizard.

    May I ask one other question?  I need to make some changes to the procedures to use DB_Mail, etc and when I have completed the testing of the database on the new server,  need to bring over JUST the data from the 2000 database.  Is there an easy way to do just that?

Thanks,
Mike
0
 
LVL 23

Expert Comment

by:Racim BOUDJAKDJI
ID: 24737577
<< Is there an easy way to do just that?>>
What you can is the following

> Make a full backup of your work database before you start working
> Restore the above full backup on your target environment by leaving the database in NORECOVERY mode.  You do that by
running

restore database <put the new name here> from disk = '<put the complete backup file path here>'
with
move '<put the logical data file name here you did get from the previous execution>' to '<put the complete file path where you want to store the data file>',
move '<put the logical log file name here you did get from the previous execution>' to '<put the complete file path where you want to store the log file>', replace, norecovery

> Finish your modifications(data)..
> Make a differential backup of your database.  You do that by running
backup database <old name> to disk = '<complete path>' with differential
> Restore the differential on the top of the currently restored database in the target server by running
restore database <put the new name here> from disk = '<put the differential complete backup file path here>'
with
move '<put the logical data file name here you did get from the previous execution>' to '<put the complete file path where you want to store the data file>',
move '<put the logical log file name here you did get from the previous execution>' to '<put the complete, recovery  

That way you won't have to do a complete restore just the difference data between the two backups...

HTH

0
 
LVL 18

Author Comment

by:Data-Man
ID: 24737647
Racimo,
   Just so I understand this....

   1.  Take the BAK file and do what I did to restore it but this time add the 'norecovery' option.
   2.  Make the changes I need to the database (really just changes to about 50 procs)
   3.  Make a differential backup of the live 2000 database.  (right now I do a full backup every night.  If it takes me a couple of days to make the changes and test, how do I create a differential backup?)
   4.  Restore the differential backup onto the 2005 database.

   It all sounds easy enough except for step 3.

Thanks for the help,
Mike
0
 
LVL 23

Expert Comment

by:Racim BOUDJAKDJI
ID: 24737780
<<1.  Take the BAK file and do what I did to restore it but this time add the 'norecovery' option.>>
Yes

<<2.  Make the changes I need to the database (really just changes to about 50 procs)>>
 Yes
 
 <<3.  Make a differential backup of the live 2000 database.  (right now I do a full backup every night.  If it takes me a couple of days to make the changes and test, >>
Make differential backup whenever you feel you reached a milestone.


<<how do I create a differential backup?)>>
As you'd do a regular backup except that you need to add WITH DIFFERENTIAL to the backup instruction.
as

backup database <name of the db> to disk='<complete file path for differential backup>' WITH DIFFERENTIAL

Note: a DIFFERENTIAL backup always refers to the last executed FULL backup.  So make sure you don't have a FULL backup running between your initial FULL backup and the *milestone* DIFFERENTIAL backup...What you can do is eventually do a FULL backup in the beginning of the week and a daily DIFFERENTIAL backup...
 
<< 4.  Restore the differential backup onto the 2005 database.>>
Yes

<<It all sounds easy enough except for step 3.>>
It really is.  Once you start using differential backups, you can't stop saying "how could I live without them until now"

Anyway good luck...
0
 
LVL 18

Author Comment

by:Data-Man
ID: 24737816
Thanks for you help.  Have a wonderful day.

Kind Regards,
Mike
0
 
LVL 23

Expert Comment

by:Racim BOUDJAKDJI
ID: 24737924
<<Thanks for you help.  Have a wonderful day.>>
Glad I could help...
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question