Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Transferring a SQL database

Posted on 2015-02-17
6
Medium Priority
?
42 Views
Last Modified: 2015-02-19
I have SQL Express 2008 R2 with an instance called "SQLEXpress" installed on Windows XP Pro machine.

I need to replace the Windows XP machine
I have installed SQL Express 2012 on a Windows 7 Pro machine.
Created an instance called "SQLExpress"

What is the best way to transfer the SQLExpress databases from the XP machine to the 7 machine?
The Import/Export function does not transfer schema.
The generate scripts function generates a 8GB SQL file. I have tried to run using sqlcmd command line tool but fails with some syntax errors and due to the size of the file I can't open and fix.

Any advice would be greatly received.
0
Comment
Question by:antonioking
5 Comments
 
LVL 14

Accepted Solution

by:
Nakul Vachhrajani earned 2000 total points
ID: 40613978
I would vouch for a simple backup/restore of the database.
0
 
LVL 14

Expert Comment

by:Nakul Vachhrajani
ID: 40613983
0
 
LVL 1

Expert Comment

by:Jelle Dedoyard
ID: 40613993
Does dettach/ attach work in express? Because then you only need to copy over the file and attach it again at the other side.
0
 
LVL 25

Expert Comment

by:Lee Savidge
ID: 40614022
Back up and restore every time. You'll need to handle any users and maintenance jobs separately as these won't transfer that way.
0
 

Author Closing Comment

by:antonioking
ID: 40618736
Thanks, backup and restore worked a treat - feel stupid now for not thinking of this myself!
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
Windocks is an independent port of Docker's open source to Windows.   This article introduces the use of SQL Server in containers, with integrated support of SQL Server database cloning.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
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

876 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