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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 :)
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.


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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Need SSIS project 2 30
Split string into 3 separate fields 5 22
SQL Convert "vertical" data to "horizontal" data 4 30
Need to find substring in SQL 3 13
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
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.

733 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