Search code examples
asp.netsql-serverclone

SQL Server 2005 Express - error after cloning machine


In order to help out one of our departments here I've cloned a machine that was on its last legs and is actually hosting some important data. The plan is to migrate to a VMware VM as soon as possible, but in the meantime I cloned the machine onto another PC for testing among other things.

I've renamed the original machine's hostname, so the new machine is running ASP.NET and SQL Server 2005 (Express) and the database-driven website (Intranet-only) is now back up and running but we're getting an error 4200 with ODBC about a login failed.

On checking the event viewer there's the following message:

Error in Event viewer application log

However it seems that SQL server still sees the local accounts as being under a much older hostname (see below:)

old hostname held by SQL server

If I try to add the user "CURRENTHOSTNAME\ASPNET" to the database in question it only sees the old hostname. Is this what's causing my problem ? I'm not sure.

I do know that to get IIS working in the first place I had to do "aspnet_reg.exe -ga CURRENTHOSTNAME\ASPNET" and that fixed my first problem but this second one has me stumped.

The third party company that supply the software are being very slow to help on this. I usually do PHP & MySQL so I've little to no knowledge of Microsoft SQL. If anybody can help me you'd really be saving my bacon as this is dragging on a couple of days now.

Thanks in advance!


Solution

  • Okay it seems to be fixed now - I re-added the NEWHOSTNAME\ASPNET to Security\Logins under "Microsoft SQL Server Management Studio Express" and then it appeared under Databases\MyDatabase\Security\Users" or I was able to add it anyway (can't remember which) - not sure if renaming the server that shows up under SELECT @@SERVERNAME makes a difference, but this error is fixed now anyway