I normally used backup and restore tool in SQL server to move one sql server database to another server in the same network; but this does not work if your db is in a remote shared hosting site like Godaddy. To get my sql db from Godaddy shared hosting environment and move it to local sql server or a different host server, I had to use Microsoft Database Publishing Wizard. This evening I have downloaded my sql server db (called it remoteDB) to my local sql 2008 express successfully, by going through these steps:
- Open a VS2010 Project (existing or create a new).
- Go to Server Explorer ->Data Connections, right click and select “Add New Connection”.
- Enter remotedb.db.xxxx.godaddyresource.com to “Server Name” and select “use SQL server authentication”; enter username and password assigned by Godaddy for the database.
- If server name, and user credential are correct and validated, your target database will now display under the “Select or enter a database name” dropdown box.
- Select the database and press OK.
- Return to Database Connections, right click on the newly added data connection, select “Publish to Provider” from the context menu.
- The Microsoft Database Publishing Wizard appears; just follow the onscreen instruction to script out all database objects for the selected database.
- When asked to “Select an Output Location”, I selected “Script to file” and saved to a sql file at local drive. “c:\development\remote\db\sqlbackup\remotedb_published_2-5-12.sql”.
- when asked to “Select Publishing Options”, I selected:
- Drop existing objects in script =True
- Schema qualify =True
- Script for target database =SQL Server 2008 (other options are 2005 and 2000)
- Type of data to publish=Schema and data
- Click on Finish.
- Now, open the localhost\SQLExpress2008 and attached the remoreDb.mdf from an older version
- Open the .sql file “remotedb_published_2-5-12.sql” and executed the sql file
- Verified all data and objects were imported as current as of 2-3-2012.
If publishing to another remote sql server, you will use SQL Server 2008 Management Studio to connect to that remote database, and execute the sql file directly against that database.