Migrate SQL Sever 2000 bak file to SQL server 2005

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
LVL 18
Data-ManCOOAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mohan_sekarCommented:
What error do you get while trying to restore the .BAK file?
0
Data-ManCOOAuthor Commented:
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
10 Tips to Protect Your Business from Ransomware

Did you know that ransomware is the most widespread, destructive malware in the world today? It accounts for 39% of all security breaches, with ransomware gangsters projected to make $11.5B in profits from online extortion by 2019.

Racim BOUDJAKDJIDatabase Architect - Dba - Data ScientistCommented:
<<  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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Data-ManCOOAuthor Commented:
Running the script now....no errors and 2 minutes into it.  wooohoo!!!!!!!

Will let you know if it works.

Thanks,
Mike
0
Data-ManCOOAuthor Commented:
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
Racim BOUDJAKDJIDatabase Architect - Dba - Data ScientistCommented:
<< 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
Data-ManCOOAuthor Commented:
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
Racim BOUDJAKDJIDatabase Architect - Dba - Data ScientistCommented:
<<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
Data-ManCOOAuthor Commented:
Thanks for you help.  Have a wonderful day.

Kind Regards,
Mike
0
Racim BOUDJAKDJIDatabase Architect - Dba - Data ScientistCommented:
<<Thanks for you help.  Have a wonderful day.>>
Glad I could help...
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2005

From novice to tech pro — start learning today.