Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 560
  • Last Modified:

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

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.
0
scottwoltjer
Asked:
scottwoltjer
  • 4
  • 3
1 Solution
 
SmightyCommented:
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).
0
 
scottwoltjerAuthor Commented:
The export import seems to easy. Any issues with that.
0
 
SmightyCommented:
Not that I know of. Have fun exporting :)
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
scottwoltjerAuthor Commented:
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!
0
 
SmightyCommented:
Please elaborate on the Errors you get while exporting the Database
0
 
scottwoltjerAuthor Commented:
When I import - export I get this:
 Validating (Error)
Messages
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: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1600.1+((KJ_RTM).100402-1539+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Restore+Server&LinkId=20476

------------------------------
ADDITIONAL INFORMATION:

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: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1600.1+((KJ_RTM).100402-1539+)&LinkId=20476

------------------------------
BUTTONS:

OK
------------------------------
0
 
Monica PSoftware DeveloperCommented:
Hi

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

http://sqlbackupandftp.com/?ref=242

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
0
 
scottwoltjerAuthor Commented:
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.

Thanks
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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