Sunday, March 29, 2020     Login

Questions?  Call:





 Guaranteed Host
Web Hosting

Official PayPal Seal

Backup and Restore MS-SQL Database Minimize


This lesson is meant to help you backup and restore your SQL database.  These instructions should help you move your data from another hosting company on to our servers, or periodically backup your data from our servers for safe keeping.

  1. Download and install the Microsoft SQL Server Database Publishing Wizard from
  2. Startup the Wizard and enter your connection information for the database you want to backup.  You should only backup the following object:
    Stored Procedures
    User-Defined Functions

    The wizard is pretty self explanatory.  The only bit of information you'll need to know is that you are scripting the database, we don't have the web service it talks about setup here.  When you are done, you should end up with an sql text file on your hard drive.
  3. If you don't have it already, download Microsoft SQL Server Management Studio Express (free) from Microsoft at:
  4. Connect to your database using Microsoft SQL Server Management Studio Express.  Make sure you click the "Options>>" button in the lower left corner when you connect so that you can specify your database name in the "Connection Properties" tab of the login dialog.  You won't be able to browse any of the databases, even yours, if you just connect without specifying your database. 
  5. Load the SQL text file you created in step 2.
  6. If you will be restoring the database to a database of a different schema (user name), replace the old schema name with an empty string in the SQL script.   That is, if your scripts read [schema].[tablename], change them to read, just [tablename].
  7. Put a use database statement on the first line, followed by GO so that the script will execute against the database you want to restore to.  Ie,

    Use myDatabase

  8. Execute the SQL.  If you get an out of memory error, you can block sections of the SQL and execute a section at a time.  Just make sure you end on a GO statement.
  9. Using this procedure, I was able to script out a DotNetNuke database from one server and put it on a new server.

You can also use the Database Publishing wizard to create scheduled backups of your database by running it from the command line on your computer:

"C:\Program Files\Microsoft SQL Server\90\Tools\Publishing\sqlpubwiz.exe" script -S SERVERNAME -d DBNAME C:\output.txt -f

Where -S --> Servername
 -d --> Database Name
 -f --> Overwrite the existing file
See Also Minimize

Windows Web Hosting
ASP.NET Web Hosting
Setting Up Email

Copyright 2007 by DMB Consulting, LLC   |  Privacy Statement  |  Terms Of Use     Skin designed by