Making a copy of mdf and ldf

  • I want to make a copy of our .MDF and .LDF files to send to a vendor. Can I just copy them, or isn't it that simple?

  • You can either create a backup file for the vendor to restore, or you can detach the database, make a copy of the .mdf, and reattach the original database. Of course detaching takes the db offline, so a backup would be best.

     

  • Whether you do an attach or restore (with move) you'll need to get him/her to create some users and give them permissions on the restored db.

    Create the user under the security branch in Enterprise manager and then run this in Query Analyser

    USE YourDbName

    EXEC sp_change_users_login 'AUTO_FIX', 'Username'

    go

    Is there an application associated with the db or is it stand alone?


    Cheers,

    Sim Lever

  • I believe the best way to do that is to really detach the db and copy it. This way you'll have a clean(unreferenced) database file with wich you can do whatever you want. Clearly there is the permissions problem but, it cannot be simply solved without using a third party aplication to generate the scripts needed to create the logins/users for the proper sql instance(or msde), the database and respective tables and columns. You can find some of these tools here at sqlcentral - you also get the marketing adds. I've been trying them and, for now, still using the enterprise manager to assemble things and administrate the server but, I like to do all by hand and, in your particular case, that should bring some unsupported expenses so, try and use a tool like «Idera», «Imceda» or «Red Gate» apps for sql server.

  • I am going to use copy of the backup. Thanks to all for the help.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply