Solved

How to copy one database into another under MSSQL Server 2005

Posted on 2009-04-02
6
267 Views
Last Modified: 2012-05-06
Looks like a simple task.
I select a database, then rightclick and select backup, then select a target file and backup is successful.

Next  I create a new database, and wishing to import the previously backup database I select "Restore" and then select the file that contains the newly created backup.

Restore won't succeed however, saying that "The backup set holds a backup of a database other than the existing..."

That makes sense, but there must be a way just to copy structure as well asw data to a new database.
0
Comment
Question by:yossikally
6 Comments
 
LVL 8

Expert Comment

by:tpi007
ID: 24049012
You need to select 'restore over' option in GUI and ensure paths exist on new server.
0
 
LVL 8

Expert Comment

by:tpi007
ID: 24049035
Screen grab below. The paths in backup in GUI will be as server where backup from and may need changing if patsh do not exist on new server.
restore.JPG
0
 
LVL 12

Expert Comment

by:udayakumarlm
ID: 24049036
for copying the schema and data  from the database use Microsoft database publishing wizard. this will create a script for the source database objects. run the script on the destination database.
0
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.

 
LVL 57

Accepted Solution

by:
Raja Jegan R earned 250 total points
ID: 24049042
I will continue from your creation of new database.

1. Right click your newly created database.
2. Choose Tasks --> Restore and do the Backup file locations.
3. Click options in the left side pane.
4. Under Restore Options, Click overwrite the Existing Database.
5. In the dropdown list below, if you see the Restore as path, you will be able to see the earlier database's MDF and LDF path.
6. Change the path to your new MDF and LDF path created for your new database.

Click OK and it is done. It will restore without any issues.
0
 
LVL 8

Expert Comment

by:tpi007
ID: 24049105
A simple way would be to use the copy database wizard as below
Copy-Database.JPG
0
 

Author Closing Comment

by:yossikally
ID: 31565752
Thanks. Complete and easy to follow.
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Suggested Solutions

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

863 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

24 Experts available now in Live!

Get 1:1 Help Now