Please use the following instructions as a guide for moving an existing Passwordstate database to a new database server. Please note these instructions will assume you have some knowledge for using the Microsoft's SQL Server Studio Management Studios tool, and have appropriate permissions to restore databases.

Note: These instructions are for Passwordstate version 6 and 7, using SQL Server Management Studio 2012 - some screens may look different to you for prior versions. If using version 5 of Passwordstate, the database will be called passwordstate5 and the SQL Account name will be passwordstate5_user.

Restore your database:

  • On your new database server, open Microsoft SQL Server Management Studio
  • Right click on 'Databases' and select 'Restore Database'
  • Click on the 'Device' eclipse and browse and select your saved database backup, and click the 'Restore' checkbox under the section 'Select the backup set to restore'
  • Click the 'OK' button to restore, then right-click on 'Databases' again and click 'Refresh' so your restored database shows
  • Navigate to Databases -> passwordstate -> Security, and delete the account passwordstate_user
  • If you receive an error message similar to 'The database principal owns a schema in the database, and cannot be dropped', then expand the 'Schemas' tree node and delete the 'passwordstate_user' schema
  • Navigate to \Security -> Logins, right click and select New Login
  • Create a new SQL Account account called passwordstate_user, setting the password to the value in your database connection string in your web.config file (located in the root of the Passwordstate folder), set Default database to passwordstate
  • Grant db_owner rights to the passwordstate database under the User Mapping page

Final Changes to your Web Site:

  • Now you need to edit the Data Source value in the web.config file for the PasswordstateConnectionString - this value needs to be the host name of your new database server. Note: if your SQL Server is installed with a named instance, then the formatting of the host name should be HostName\SQLInstance
  • Restart the Passwordstate Windows Service so it picks up the changes in the web.config file
  • And restart your Passwordstate web site in IIS. You should now be able to point your browser to the Passwordstate web site, and successfully connect to your new database server