Rebuilding the Web.config File
This topic will discuss how to take the default web.config file from a new Passwordstate installation, and configure it so the website can communicate with your existing Passwordstate database. This document should only ever be needed if you have a server crash, and do not have a backup of your web.config file.
There are 3 areas in the web.config file which need to be modified, and they are:
- The database connection string
- The SetupStage key
- And the Secret1 and Secret2 keys

Modify Web.Config File
The following settings need to be updated in the Passwordstate ConnectionString
- Data Source - this is the host name of your database server. If you have a specific Instance Name for you SQL install as well, this will need to be appended i.e. HostName\SQLExpress
- User ID - this should be passwordstate_user
- The password for the passwordstate_user SQL account (if you are not sure of what this password would be, there are instructions below on how to reset this)
The SetupStage key needs to be set to "Setup Complete"
The PassiveNode key can be deleted, as this is only used during new installs of Passwordstate, and is removed after the install is complete
Copy the Secret1 and Secret2 values across from a backup of your previous web.config file if available. If not, during the initial install of Passwordstate you would have been asked export your encryption keys to a password protected zip file - these encryption keys can also be exported anytime from the screen Administration -> Encryption Keys. Note: if you do not have these secrets, it is not possible to recover your system.
Reset Password for Passwordstate_User SQL Account
As you have specified what is most likely a new password for the passwordstate_user SQL Account, you will need to reset this password on your SQL Server. To do this, please follow these instructions - Resetting Password for Passwordstate_User SQL Account