Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 How to copy a DB to another Pc

Author  Topic 

shifis
Posting Yak Master

157 Posts

Posted - 2006-09-14 : 18:25:41
Hi
I did and application that uses a small sql database and tomorrow I will install it to one of our clients.
Is the first time that I have to copy a Data Base to another company.

This company doesn't have SQL install so I was thinking on install sql personal edition server and client. But If I do that and I do and script of my DataBase how can I create it?
Actually to copy the db to another server I uses de Query analyser, but I don't know how to run an scrip with out it.

Thanks for your help.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2006-09-14 : 19:02:14
Personal Edition can not be used at a client site. If you are looking for a free version of SQL Server, then you will need to use MSDE. This version does not come with GUI tools, so you must run things from the command line. The command line version of Query Analyzer and Enterprise Manager is osql.exe.

To copy a database, just backup the source, copy the BAK file to the destination server, then perform a restore on the destination.

Tara Kizer
Go to Top of Page

anilkdanta
Starting Member

25 Posts

Posted - 2006-09-15 : 02:26:41
Shifis,

Install SQL Server (not client tools) Enterprise Edition on a Windows NT/2000 Server.

Then do the following :

1) Take backup of the database to a location different from regular back up directory (dbname_date_time.bak).
2) Copy this file on to your customer's Server
3) Create a new Database with the same name on your customer's Server.
4) Restore the database with the .bak file.

The reason I suggested you to take back up on a different location is, If you take a back-up to default location, you will not be able to copy this file to a storage device because it will be in use by the server always. In this case you have to detatch the database and copy the file, then atatch the database again. This is unnecessary work.

Hope this makes your LIFE SMOOTH!

Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2006-09-15 : 04:21:30
Sorry anilkdanta, I have a number of issues with that

I don't think for a moment his client is wanting to afford the Enterprise Edition !!

I would not advise backing up to a different location - if a schedule of differential backups is running and someone needs to restore they may have a struggle finding the backup file or, worse, the backup being in a non-standard location may cause the user to think it is OK to then just delete it.

And with regard to (3) there is no need to pre-create the database because the restore can do that. It does no harm of course!

" If you take a back-up to default location, you will not be able to copy this file to a storage device because it will be in use by the server always"

That won't be the case once the backup has finished writing.

shifis: Also beware that you will need to sort out the User's of the database. On your original machine the Server Logins will have been allocated IDs, and the Users assigned to your database will have been allocated those same IDs.

When you restore the database onto a new server the User IDs in your database will not be synchronised with the Login IDs, but there are plenty of scripts around to sort this out for you.

If you are used to using Enterprise Manager, rather than "raw SQL", for Admin then the commands for RESTORE may be a bit daunting! the RESTORE syntax / example can be found here:

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=55210&SearchTerms=RESTORE%20syntax%20/%20example,Restore

Kristen
Go to Top of Page

Luis Martin
Yak Posting Veteran

54 Posts

Posted - 2006-09-15 : 10:26:23
MSDE is the only way to keep you and your customer save.
Go to Top of Page
   

- Advertisement -