Jump to content

Rebuilding Web.Config File


Recommended Posts

This topic will discuss how to take the default web.config file from a new Passwordstate installation, and configure it so the web site 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 (Note: these secrets are not relevant if you are using a build of Passwordstate prior to 7580 - see section below if you are not sure what build you're currently running)



Determine Current Passwordstate Build Number

Using SQL Server Management Studio, make a connection to your database server and execute the following query:


USE Passwordstate

SELECT BuildNo FROM [systemSettings]


It is in the next section you need to know your Build Number, so you know whether the Secret1 and Secret2 keys are required or not.


Modify Web.Config File

  • The following settings need to be updated in the PasswordstateConnectionString
    • 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"
  • If you are using Build 7580 or above, you will need to copy the Secret1 and Secret2 values across from the encryption keys which you would have been asked previously to export. Note: if you do not have these secrets, it is not possible to recover your system. If you are using a build earlier than 7580, you must delete these two Secrets from the web.config file.


Reset Password for Passwordstate_User SQL Account

  • Open SQL Management Studio and make a connection to your database server
  • Browse to the Security -> Logins section, and double click on the passwordstate_user SQL Account
  • Reset the password based on the following two screenshots




Authorized Web Server

You are now able to point your browser to the URL of your Passwordstate web site. When you do, it will tell you the server is not "authorized" to host the Passwordstate application. You can use your Emergency Access login to fix this. If you do not know this account password, then follow on screen instructions so Click Studios can help you recover this account.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...