Skip Navigation LinksHome > Categories > Code from a Category

Restore MS Sql database from Godaddy server to local PC



User Name: jamest85
Name: James T
Contact Me: www.datawebcoder.com/ContactUs.aspx
Home Page: www.datawebcoder.com
Certified Zoho CRM Consultant. 4 years experience on Zoho consulting, implementation, and programming using C#, VB, Php..., 9 years of total IT experience including programming and application develop... [More]
Viewed Times: 169
Add Date: 12/27/2011
Had couple of issues on restoring MS Sql database from Godaddy Server to Local PC, such as: local pc's permission, database settings...
Below are the steps:

1. Create a new database in local server with the same name as the one from Godaddy server.

2. You might have permission issue such as: “System.Data.SqlClient.SqlError: The operating system returned the error '5(Access is denied.)' while attempting 'RestoreContainer::ValidateTargetForCreation' on 'c:\Program Files\Microsoft SQL Server\MSSQL.2\MSSQL\[my database name].mdf'. (Microsoft.SqlServer.Express.Smo)”


3. Make sure you (as local pc user) have the “Full control” permission, and check all the sub folders as well, such as: C:\Program Files (x86)\Microsoft SQL Server\MSSQL.1\MSSQL


4. When restoring the .bak file, you should use WITH REPLACE option of RESTORE command, or in SQL Server Management studio select “Options” page and check “Overwrite the existing database (WITH REPLACE)”, see detail here..


5. When you run your website by using VS 2005, or VS 2008, the membership function might not work, because local database will add extra Application Name, and ApplicationId in the “Application” table


Or: Register a new user in this local website, and go to table: aspnet_Applications, see if system created a new Application record, if yes, then you know you need use the newly created Application info for other related table, see below.

6. Other tables: such as Membership, Roles, Users might as the ApplicationId from godaddy server db, you need change them to the new ApplicationID. Or: I am pretty sure you can change the setting in your .config file so can use the Application values from Godaddy server.

Post a Comment

Name: (Optional)
Email: (Optional, you can get an email if somebody replys your comments)*
Email me if somebody respons my comment below:
Details**:
Enter Text
as Below:
(case insensitive, if hard to read, click the "get a new one" button)
 
    
* Your email address will not be shared with any third parties for any reason.
** Maximum 1000 charactors.