Can't connect to database after server move

Post here for help with installing or upgrading mojoPortal pre-compiled release packages. When posting in this forum, please provide all relevant details. You may also want to review the installation or upgrading documentation.

If you have questions about using the source code or working with mojoPortal in Visual Studio, please post in the Developer forum.

Post here for help with installation of mojoPortal pre-compiled release packages

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.

You may also want to review the installation or upgrading documentation.

If you have questions about using the source code or working with mojoPortal in Visual Studio, please post in the Developer forum.

This thread is closed to new posts. You must sign in to post in the forums.
5/31/2010 1:59:37 PM
Gravatar
Total Posts 2

Can't connect to database after server move

I just replaced the server in my office, and am running into problems transfering MojoPortal onto the new server.  Here's what I did:

  1. Backed-up the database on the old server using the SQL Server Management Studio (RtClick  -> Tasks -> Back up...)
  2. Copy the root of the site to a portable drive, along with the backed-up database.
  3. Copy the site onto the new server, set permissions as if configuring a new mojoportal installation.
  4. Restore the database backup onto the new server using the management studio.

The original server was 2003R2 standard, running MSSQL 2008.  The new server is 2008R2 standard, running MSSQL 2008R2.  Yes, the SQL server and IIS are running on the same box in both the old and new machines.

This is what it's doing:

Welcome to mojoPortal Setup
Probing system...
File system permissions ok.

The system cannot connect to the MSSQL database. Please check your connection string.


System.Data.SqlClient.SqlException: Cannot open database "mojoportal" requested by the login. The login failed. Login failed for user 'mojouser'. at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) at System.Data.SqlClient.SqlConnection.Open() at mojoPortal.Data.DBPortal.DatabaseHelperGetConnectionError(String overrideConnectionInfo)

I've verified that the mojoportal database was restored, the mojouser account is present, the password appears to be correct (though I can't seem to check that in the management studio), so I'm stumped at this point.  Am I missing something?

5/31/2010 2:04:10 PM
Gravatar
Total Posts 18439

Re: Can't connect to database after server move

Hi,

It is because when you restore a db on another machine the sql user gets orphaned. You can either create a new user and make him dbo on the database and use the new user in the connection string or un-orphan the existing user.

Hope it helps,

Joe

5/31/2010 2:32:20 PM
Gravatar
Total Posts 2

Re: Can't connect to database after server move

Awesome, that did it!  Thanks!

You must sign in to post in the forums. This thread is closed to new posts.