Using SQL Server Management studio - Take my live database and copy it to my test database.

Posted on 2013-01-12
Last Modified: 2013-01-30
Using SQL Server Management studio - Take my live database and copy it to my test database.
I need my data to be the same in test as it is in live. I want to learn how to do this using the stuido.
I have SQL 2008 R2.
Question by:scottwoltjer
  • 4
  • 3

Accepted Solution

Smighty earned 500 total points
ID: 38770635
You can do this three ways:

Either by Exporting/import, Backup/Restore or Detach/Copy/Attach the Database.
The result should be the same.

For the Export:
Right click on your Database > Tasks > Export Database.
Import it on the new Server

For the Backup/Restore:
Right click on your Database > Tasks > Backup (Select a full backup)
Create a new (empty) database with the same name on the new Server
Import the Content from the previously made Backup

If you have the Luxury to Take your Database offline, you could simply do that, Copy the MDF/LDF Files to the new server and attach it anew there. (don't forget to reactivate your database on the source server).

Author Comment

ID: 38770875
The export import seems to easy. Any issues with that.

Expert Comment

ID: 38771827
Not that I know of. Have fun exporting :)
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.


Author Comment

ID: 38772477
Well I cant get these to work.
Import / Export gives me all kinds of errors
Restore from other database errors out as well.

All I want to do is have all the data in my tables and views to be the same. Please help have to have this done today!

Expert Comment

ID: 38772647
Please elaborate on the Errors you get while exporting the Database

Author Comment

ID: 38772906
When I import - export I get this:
 Validating (Error)
Error 0xc0202049: Data Flow Task 1: Failure inserting into the read-only column "TimeStamp".
 (SQL Server Import and Export Wizard)
Error 0xc0202045: Data Flow Task 1: Column metadata validation failed.
 (SQL Server Import and Export Wizard)
Error 0xc004706b: Data Flow Task 1: "component "Destination - AbcAnalysis" (79)" failed validation and returned validation status "VS_ISBROKEN".
 (SQL Server Import and Export Wizard)
Error 0xc004700c: Data Flow Task 1: One or more component failed validation.
 (SQL Server Import and Export Wizard)
Error 0xc0024107: Data Flow Task 1: There were errors during task validation.
 (SQL Server Import and Export Wizard)
When I restore I get this:
TITLE: Microsoft SQL Server Management Studio

Restore failed for Server 'sysprosrv'.  (Microsoft.SqlServer.SmoExtended)

For help, click:


System.Data.SqlClient.SqlError: The tail of the log for the database "SysproCompanyTest" has not been backed up. Use BACKUP LOG WITH NORECOVERY to backup the log if it contains work you do not want to lose. Use the WITH REPLACE or WITH STOPAT clause of the RESTORE statement to just overwrite the contents of the log. (Microsoft.SqlServer.Smo)

For help, click:


LVL 10

Expert Comment

by:Monica P
ID: 38787117

Use this tool to make ur job much easier..I am in Use of this ..

Install this ..Take a Backup of local or remote Database and restore it in Remote or local Database

Before restoring create Restoring Database Name and then restore..

Just give a try on thiss

Author Closing Comment

ID: 38837078
I have tested what you sent on a differnt database and it worked. The database I needed this on has some files attahed to it that the vendor did not tell me about so it will not copy over with out them doing a list of procedures to unlock these files.


Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Help with SQL Server Polygon 2 32
Attaching Database Failed ? 3 37
Sql Server group by 10 23
SQL Syntax: How to force case sensitive query? 2 20
I wrote this interesting script that really help me find jobs or procedures when working in a huge environment. I could I have written it as a Procedure but then I would have to have it on each machine or have a link to a server-related search that …
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

813 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now