Solved

How to Clone a live MS SQL database for testing purposes

Posted on 2010-11-22
7
793 Views
Last Modified: 2012-10-27
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
Comment
Question by:kabutz
7 Comments
 
LVL 16

Assisted Solution

by:EvilPostIt
EvilPostIt earned 41 total points
ID: 34188203
Backup then restore. Dependant on what you actually want to do then you may have to re-link the logins again.
0
 

Author Comment

by:kabutz
ID: 34188565
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
 
LVL 16

Expert Comment

by:EvilPostIt
ID: 34188601
You will have to do a new installation of SQL Server.
0
Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

 
LVL 10

Accepted Solution

by:
Humpdy earned 42 total points
ID: 34188827
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
 

Author Comment

by:kabutz
ID: 34189020
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
 
LVL 18

Expert Comment

by:lludden
ID: 34189065
Just do a backup and restore it with a different name.
0
 
LVL 11

Assisted Solution

by:mattibutt
mattibutt earned 42 total points
ID: 34191143
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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Suggested Solutions

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
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
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

770 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