Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Nick 34 posts 127 karma points
    Dec 18, 2015 @ 11:47
    Nick
    0

    Deploying to new enivronment

    Hi

    I've been trying to deploy to a new UAT environment for my Umbraco. I copy over the database and I did a web deploy. I've excluded the app_ data folder in my deployment. Everytime I do the deploy it ask to reinstall Umbraco but my database is already up to date and the web.config app key umbracoConfigurationStatus has already been set to 7.3.4. The Umbraco upgrade also fails.

    I am wonder how do I deploy an existing system to a new environment?

    Thanks Nick

  • Marc Goodson 2155 posts 14408 karma points MVP 9x c-trib
    Dec 18, 2015 @ 20:01
    Marc Goodson
    0

    Hi Nick

    Have a look in the UmbracoTraceLog.txt file in /app_data/logs

    Often Umbraco will log a clue as to what the problem might be (eg if it detects the database is a different version to the configuration - which from what you've described it shouldn't be, but there will probably be some good info there as to what it is stumbling over).

    Can the new environment 'see the database' ok ?

    Usual problems in this scenario include, something 'not included in your visual studio project' and so Web Deploy has missed it out when deploying to your new server; so compare the folders between your new location and your dev environment.

    Are any config transforms being processed during web deploy; that may have the wrong db connection settings / umbracoConfigurationStatus, eg locally all is fine, but web.release, is mucking up the details during deploy.

    Finally if you have pretty much the identical set of folders and code on your new environment as to your dev; and your 100% confident new environment can see the database, and login successfully with the username and password in web.config and it's the same database! Then check the permissions on the web folders for the IIS Apppool account...

    Post any cryptic error message you find in the logs!

    regards

    Marc

  • Cory Colt 34 posts 130 karma points
    Apr 28, 2016 @ 15:27
    Cory Colt
    0

    Marc,

    I'm having a similar problem as this and when I look in the log files I see the error below. This is Umbraco 7.3.4 and was developed locally and now I'm trying to get it published to a production environment. The database is SQL Express (same as I used in development). I see that the error shows an issue with the umbracoUser, but I didn't have to do anything with this in development, so I'm wondering if this is actually a different issue than what this is saying?

    (Also, I replaced the actual name of the database with "Northwind" when I pasted the error.)

    2016-04-27 13:49:50,424 [P444/D2/T8] ERROR Umbraco.Core.Persistence.UmbracoDatabase - Database exception occurred
    System.Data.SqlClient.SqlException (0x80131904): **The SELECT permission was denied on the object 'umbracoUser', database 'Northwind', schema 'dbo'.**
       at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
       at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
       at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
       at System.Data.SqlClient.SqlDataReader.get_MetaData()
       at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
       at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
       at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
       at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
       at System.Data.SqlClient.SqlCommand.ExecuteScalar()
       at StackExchange.Profiling.Data.ProfiledDbCommand.ExecuteScalar()
       at Umbraco.Core.Persistence.PetaPocoCommandExtensions.<>c__DisplayClassa.<ExecuteScalarWithRetry>b__9()
       at Umbraco.Core.Persistence.FaultHandling.RetryPolicy.ExecuteAction[TResult](Func`1 func)
       at Umbraco.Core.Persistence.Database.ExecuteScalar[T](String sql, Object[] args)
    ClientConnectionId:22fd975b-3a87-4b75-9aed-5c337caf186a
    Error Number:229,State:5,Class:14
    
  • Nick 34 posts 127 karma points
    Apr 28, 2016 @ 15:32
    Nick
    0

    Hi Cory

    In the connection string, is the database user the owner of the database schema?

    I had a permission issue where the database user I was using wasn't the owner so couldnt upgrade the database

  • Cory Colt 34 posts 130 karma points
    Apr 28, 2016 @ 15:39
    Cory Colt
    0

    Nick,

    Thanks for the quick reply! So I developed this locally on SQL Express and only connected to the database using windows authentication. Once I was ready to move this out into production I took a backup on the database and restored it to the SQL Express in the production environment. Right now I'm still using windows authentication in the connection string:

    Data Source=.\SQLEXPRESS;Initial Catalog=Northwind;Integrated Security=SSPI;
    

    I would assume both user accounts on both my dev and production environment would be the owner of the database schema. Is this an accurate assumption?

  • Nick 34 posts 127 karma points
    Apr 28, 2016 @ 15:51
    Nick
    0

    It depends on how the user was set on the database. I would double check the database user on the production sever. You should be able to find the users for the database and check their permissions. It does look like you have a permission issue

Please Sign in or register to post replies

Write your reply to:

Draft