locked
migrateuser stsadm "unable to connect to database" error RRS feed

  • Question

  • Hi.

    We are trying to migrate a test user using stsadm -o migrateuser command but we keep getting the error "unable to connect to database".  Of course the error does not tell us which database it cannot connect to.

    We are running the command as the logged in user which is the sharepoint admin account.

    The databases are up and running and there are no network issues.

    We can connect to the database using the sharepoint admin credentials.

    How can we fix?

    Wednesday, October 24, 2012 4:58 PM

Answers

  • A user's information is stored in the content databases used by every site collection the user has ever tried to visit. This means there could be several instances of the user in multiple content databases.

    The migrateuser stsadm operation will go through every content databases in the farm to ensure that if the user does exist, that they are updated with the new alias.

    My guess is the account you are using does not have rights to one or more of the content databases. And this is normal. When you create a content databse through Central Administration, your administrative account is not assigned any roles or permissions in the database. This is intentional and is a good security practice (yes, it sounds like an oxymoron). If you require rights in the database then you need a SQL Server administrator to give your administrator read/write rights (dbo) on the databases.

    Edit: You said you can connect, but chances are you can't edit anything (don't try, this isn't supported). Verify you have rights to edit the database.


    Jason Warren
    Infrastructure Architect


    Wednesday, October 24, 2012 5:07 PM
  • From my understanding, when you use stsadm -o migrateuser command it is going through all of the content databases in your Farm. If, by chance, you have dropped a database from SQL Server Management Studio rather than removing it from Central Administration the stsadm command is looking at  the config database and since it does not see the missing database will throw errors to the SQL Logs, but all you will see is the unable to connect because the database does not exist.

    Go to Central Admin -> Application Management -> Manage Content Databases and search through all the Web apps and Site Collections to see if you have all your databases there that are in SQL Server.

    Hope this helps

    --

    Dave

    • Proposed as answer by drmcgee2000 Tuesday, November 6, 2012 9:39 PM
    • Marked as answer by motionpotion Wednesday, November 7, 2012 12:35 PM
    Tuesday, November 6, 2012 9:39 PM

All replies

  • A user's information is stored in the content databases used by every site collection the user has ever tried to visit. This means there could be several instances of the user in multiple content databases.

    The migrateuser stsadm operation will go through every content databases in the farm to ensure that if the user does exist, that they are updated with the new alias.

    My guess is the account you are using does not have rights to one or more of the content databases. And this is normal. When you create a content databse through Central Administration, your administrative account is not assigned any roles or permissions in the database. This is intentional and is a good security practice (yes, it sounds like an oxymoron). If you require rights in the database then you need a SQL Server administrator to give your administrator read/write rights (dbo) on the databases.

    Edit: You said you can connect, but chances are you can't edit anything (don't try, this isn't supported). Verify you have rights to edit the database.


    Jason Warren
    Infrastructure Architect


    Wednesday, October 24, 2012 5:07 PM
  • From my understanding, when you use stsadm -o migrateuser command it is going through all of the content databases in your Farm. If, by chance, you have dropped a database from SQL Server Management Studio rather than removing it from Central Administration the stsadm command is looking at  the config database and since it does not see the missing database will throw errors to the SQL Logs, but all you will see is the unable to connect because the database does not exist.

    Go to Central Admin -> Application Management -> Manage Content Databases and search through all the Web apps and Site Collections to see if you have all your databases there that are in SQL Server.

    Hope this helps

    --

    Dave

    • Proposed as answer by drmcgee2000 Tuesday, November 6, 2012 9:39 PM
    • Marked as answer by motionpotion Wednesday, November 7, 2012 12:35 PM
    Tuesday, November 6, 2012 9:39 PM