Invalid object name 'umbracoUser'. Options
warren
Posted: Tuesday, September 12, 2006 3:59:35 PM

Rank: Addict

Joined: 7/19/2006
Posts: 777
Location: Leigh-on-Sea, Essex, UK
Hello all,

We have recently got ourselves a new server and we want to move the existing umbraco sites onto the new server. I FTP'd the files across and dettached the DB files from SQL and attached them on the new server.

I load the page and get the following error,




Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Invalid object name 'umbracoUser'.

Source Error:An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Code:
[SqlException (0x80131904): Invalid object name 'umbracoUser'.]
   System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +857418
   System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +735030
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188
   System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1838
   System.Data.SqlClient.SqlDataReader.ConsumeMetaData() +31
   System.Data.SqlClient.SqlDataReader.get_MetaData() +62
   System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +297
   System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +886
   System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +132
   System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +32
   System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +122
   System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior) +62
   Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteReader(SqlConnection connection, SqlTransaction transaction, CommandType commandType, String commandText, SqlParameter[] commandParameters, SqlConnectionOwnership connectionOwnership) +81
   Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteReader(String connectionString, CommandType commandType, String commandText, SqlParameter[] commandParameters) +88
   umbraco.BusinessLogic.User.setupUser(Int32 ID) in C:\data\umbraco\_umbraco2.1\umbraco\businesslogic\User.cs:55
   umbraco.BusinessLogic.User..ctor(Int32 ID) in C:\data\umbraco\_umbraco2.1\umbraco\businesslogic\User.cs:38
   umbraco.Global.Session_Start(Object sender, EventArgs e) in F:\umbraco\umbraco2.1\umbraco\presentation\Global.asax.cs:94
   System.Web.SessionState.SessionStateModule.RaiseOnStart(EventArgs e) +138
   System.Web.SessionState.SessionStateModule.CompleteAcquireState() +351
   System.Web.SessionState.SessionStateModule.BeginAcquireState(Object source, EventArgs e, AsyncCallback cb, Object extraData) +1039
   System.Web.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +158
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +146



The exisitng error can be seen here,
http://vps.momo.co.uk

Any help would be most appreciated,
Warren

Warren Buckley an Umbraco MVP 08-09 & level 1 certified developer
PeterD
Posted: Tuesday, September 12, 2006 4:24:19 PM

Rank: Fanatic

Joined: 7/20/2006
Posts: 488
Location: NL
I do get another message:

Cannot open database requested in login 'JFS_Umbraco'. Login fails.
Login failed for user 'cms'.

This indicates that the user specified in web.config does not have access on your SQL-server.

Working on an events-calendar with recursion. Post requests on my blog!
warren
Posted: Tuesday, September 12, 2006 4:31:35 PM

Rank: Addict

Joined: 7/19/2006
Posts: 777
Location: Leigh-on-Sea, Essex, UK
Sorry I just tried something out to see if it worked and no luck.
Im back to the same error message try looking again.
http://vps.momo.co.uk

Warren Buckley an Umbraco MVP 08-09 & level 1 certified developer
PeterD
Posted: Tuesday, September 12, 2006 4:37:16 PM

Rank: Fanatic

Joined: 7/20/2006
Posts: 488
Location: NL
If you detached and attached our DB again, check on the DB-server if the same user is available and make sure it has the same restrictions and password. Users are NOT part of the DB, so will not be automatically be copied to the new server.

Right now you have enableStats set to True right?
If you set that to false, you probably get the message that I showed.

Working on an events-calendar with recursion. Post requests on my blog!
warren
Posted: Tuesday, September 12, 2006 4:43:47 PM

Rank: Addict

Joined: 7/19/2006
Posts: 777
Location: Leigh-on-Sea, Essex, UK
After setting enablestat to false

I get Invalid object name 'umbracoDomains'.

http://vps.momo.co.uk/

When I originally attached the DB the user was not set up on the new server. I created the user and then dettached and reattached the database.

In the users I have the following.

Name: cms
Login Name: (BLANK)

Name: dbo
Login Name: cms



Warren Buckley an Umbraco MVP 08-09 & level 1 certified developer
warren
Posted: Tuesday, September 12, 2006 5:13:37 PM

Rank: Addict

Joined: 7/19/2006
Posts: 777
Location: Leigh-on-Sea, Essex, UK
OK.

I have setup a new DB user and gone through the INSTALL wizard with this new user and this has wiped umbraco but least it loads.

Now I have an empty but working version of umbraco is there an easy way to get the data into umbraco?

Warren Buckley an Umbraco MVP 08-09 & level 1 certified developer
PeterD
Posted: Tuesday, September 12, 2006 6:04:08 PM

Rank: Fanatic

Joined: 7/20/2006
Posts: 488
Location: NL
If you used the same username as the other DB, then you should now be able to detach this db, and then attach the new file again in order to get your data back in place.

Working on an events-calendar with recursion. Post requests on my blog!
warren
Posted: Tuesday, September 12, 2006 6:10:39 PM

Rank: Addict

Joined: 7/19/2006
Posts: 777
Location: Leigh-on-Sea, Essex, UK
Thats what I thought. I am having serious trouble with this.

When I attach the DB on the new server the "cms" user I have set up displays as

Name: cms
Login Name: (blank)


I think this is the problem. I dont know how to change the empty Login Name to "cms" which it should be.

It should display as

Name: cms
Login Name: cms



Can anyone help me, this is driving me mad!



Warren Buckley an Umbraco MVP 08-09 & level 1 certified developer
PeterD
Posted: Tuesday, September 12, 2006 6:13:18 PM

Rank: Fanatic

Joined: 7/20/2006
Posts: 488
Location: NL
Ok, after you attached the DB, goto the properties of the DB and delete the user there.
Then goto the general users-section of SQL-server and modify the user cms there to have access to the new DB again. I know something like that was posted earlier here too I think, not sure where though, but I'll try to find it.

Working on an events-calendar with recursion. Post requests on my blog!
PeterD
Posted: Tuesday, September 12, 2006 6:17:22 PM

Rank: Fanatic

Joined: 7/20/2006
Posts: 488
Location: NL
Here it is


Working on an events-calendar with recursion. Post requests on my blog!
warren
Posted: Tuesday, September 12, 2006 6:35:01 PM

Rank: Addict

Joined: 7/19/2006
Posts: 777
Location: Leigh-on-Sea, Essex, UK
Here is my solution

Copy the code below into SQL Query Analyzer

This fixed my issue of

Name: cms
Login Name: (blank)

and Resolved it to

Name: cms
Login Name: cms

the bold bits change as necessary to you.

**************************************************************************************

--Change the user account to link with the 'umbraco' login.

USE JFS_V2Umbraco
go
EXEC sp_change_users_login 'Update_One', 'cms', 'cms'

Warren Buckley an Umbraco MVP 08-09 & level 1 certified developer
yvk431
Posted: Thursday, November 01, 2007 7:35:28 AM
Rank: Newbie

Joined: 11/1/2007
Posts: 1
thats really awesome dude , i wasted almost 3 full days for that , thanks allot man .
dconlisk
Posted: Thursday, November 01, 2007 10:50:59 AM

Rank: Devotee

Joined: 10/19/2007
Posts: 52
Location: Glasgow, Scotland
Hi guys,

I was having this problem yesterday on my first Umbraco site. I had found that piece of SQL code online too, but what I need is a way to upload the latest version of Umbraco from dev to live with the minimum of fuss - if you forget to run that line of SQL then your users get a very nasty error message.
What I found was that once I'd managed to get the site up and running on your live server, with the correct users and logins set, is that it's better to use the SQL Server Export Data wizard to upload your new data.

In SQL Server Enterprise Manager, right click on your database (dev machine), and choose All Tasks -> Export Data...
Click next, next and enter the details of your live database and click next
Choose "Copy objects and data between SQL Server databases" and click next
Uncheck "include all dependent objects"
Check "Use Collation"
Uncheck "Copy all objects". Click the Select Objects... button and choose only those items you need to update, typically all tables. Click OK.
Uncheck "Use default options". Click the Options... button. Uncheck "Copy database users and database roles". Uncheck "Copy object-level permissions". Click OK.
Click next, and here you can decide if you want to run it immediately or not.

This solution works for me. It's a one-step (albeit kind of a long step!) solution and no need to go running SQL queries to sort your users out.

Hope that helps!

Dave




David Conlisk - Umbraco level 2 certified
web-garden.co.uk
mlm
Posted: Wednesday, July 16, 2008 10:14:12 AM
Rank: Enthusiast

Joined: 10/9/2006
Posts: 14
I have seen this error recently when I had copied umbraco installation from on server to another.

The problem was that the owner of the imported tables was different from the db userer i logged into the db with.

I resolved this by changing the default scheme for db user to the old user.

This can be done with MS sqlserver management studio express.

Connect to your DB
Select your database
Select Security / Users
Select Properties on the database user you are connecting with.
Set Default Scheme to the user that owns the tables.
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.