• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 832
  • Last Modified:

How to Clone a live MS SQL database for testing purposes

Hi
I want to clone a  MS SQL 2008 R2 database  onto the same server under a new DB instance / name. What is simplest way to achieve this ?

Also Db has a Spatial table with GIS data in it - any special actions to cater for this ?

THX

Kevin
0
kabutz
Asked:
kabutz
3 Solutions
 
EvilPostItCommented:
Backup then restore. Dependant on what you actually want to do then you may have to re-link the logins again.
0
 
kabutzAuthor Commented:
Tried that

I get a message instance already exists if I just do a restore.  I want a clone on same server to do testing on without affecting original instance.

Where do i set a new instance name ?

kevin
0
 
EvilPostItCommented:
You will have to do a new installation of SQL Server.
0
Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

 
HumpdyCommented:
As Dr. Evil said, if you want to have a new instance, then you'll need to install SQL Server and have a separate instance.

I get the feeling though you just need to replicate the database within the same sql installation/instance you already have.
If that's the case, you just create a blank database, take a backup of your existing database, and restore to the newly created database. When doing the restore, click in options, and click on override existing database, and make sure you point the data file and log file to the newly created database.
I think you're restore you're trying to do is using the same name for the transaction logs and data file as your existing database is using.
0
 
kabutzAuthor Commented:
Aha.. Yes -- will try that -

apologies my use of the term "instance " was misleading -
yes I want a cloned DB within the same SQL instance / installation.
0
 
lluddenCommented:
Just do a backup and restore it with a different name.
0
 
mattibuttCommented:
You are not selecting new database this is a default settings when you select backup file it automatically selects the original database file change both log file as well data file from file option
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now