Copied to clipboard

Flag this post as spam?

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


  • dewi 12 posts 32 karma points
    Mar 14, 2012 @ 00:52
    dewi
    0

    run existing umbraco files locally on my laptop

     

    Hi Guys.. I am newbie in Umbraco, so any help would be highly appreciated.

    The case is I have existing umbraco code along with its databases back up. Could you guide me how to run it locally on my computer?

    Steps I have done :

    - Restore the database back up to my SQL Server R2

    - Installed umbraco application in my laptop and open those files in microsoft web matrix

    - I have modified the connection string in web.config to connect to my databases but i dont think that was succeed..

    and the error i got when running the sites is 

    [SqlException (0x80131904): Invalid object name 'umbracoUser'.]
    
  • Paul Blair 466 posts 731 karma points
    Mar 14, 2012 @ 01:49
    Paul Blair
    0

    When you do a DB restore onto a different server it doesn't restore user logins. This is called orphaned users. See this article for a fix:

    http://www.fileformat.info/tip/microsoft/sql_orphan_user.htm

    Cheers

    Paul

  • Rodion Novoselov 694 posts 859 karma points
    Mar 14, 2012 @ 12:05
    Rodion Novoselov
    0

    Hi. Paul is absolutely right, but the article linked is a bit outdated. In Sql 2005 and later (2008, 2008 R2, etc) you need to run the "ALTER USER" T-SQL command to re-associate the database user with his login, like this:

    USE your_umbraco_db

    ALTER USER umbracoUser WITH LOGIN = umbracoUser

     

  • Paul Blair 466 posts 731 karma points
    Mar 14, 2012 @ 20:33
    Paul Blair
    0

    @Rodion - I should of looked at the SQL version before posting the link ;) I think you'll find that those SP's I pointed to are still part of SQL 2005/2008+ and are still a valid way of performing the task (http://msdn.microsoft.com/en-us/library/ms175475.aspx). It also has the advantage of creating the users if they don't exist but as you pointed out there are other ways of doing this also.

    Cheers
    Paul

  • dewi 12 posts 32 karma points
    Mar 15, 2012 @ 05:16
    dewi
    0

    Thank you for the replies..

    I have tried to do

    EXEC sp_change_users_login 'Report'

    and for some database they returned the orphaned user,, and I fixed it with this code

    EXEC sp_change_users_login 'Auto_Fix', 'umbracoUser', NULL, '1234'

    then i got this result

    The number of orphaned users fixed by updating users was 0.

    The number of orphaned users fixed by adding new logins and then updating users was 0.

    Does somebody know what went wrong with my database?

     

     



     

     

     

  • Paul Blair 466 posts 731 karma points
    Mar 15, 2012 @ 07:14
    Paul Blair
    0

    does the user already exist on your server. If it does try:

    EXEC sp_change_users_login 'Auto_Fix', 'umbracoUser'

    otherwise I think it will be

    EXEC sp_change_users_login 'Auto_Fix', 'umbracoUser', 'umbracoUser', '1234'

  • dewi 12 posts 32 karma points
    Mar 18, 2012 @ 11:35
    dewi
    0

    hi guys thanks for the replies..

    i have tried all of them,, no success yet :(

  • Paul Blair 466 posts 731 karma points
    Mar 18, 2012 @ 21:55
    Paul Blair
    0

    can you log onto SQL management studio locally using the credentials you have set up?

  • dewi 12 posts 32 karma points
    Mar 20, 2012 @ 02:37
    dewi
    0

    Hi Paul...

    Yup.. tried your suggestion but still having the same error.. anything I can provide in this forum to help the prosperous helper ? :)

  • Paul Blair 466 posts 731 karma points
    Mar 20, 2012 @ 03:12
    Paul Blair
    0

     - view the local database in SQL management studio. It has all the Umbraco tables? You must be logging on with something...

     - change the connection string to user="sa" and use your local password (possibly blank) - just to get it working we can change later

     - provide a screenshot of your managment studio showing the security section expanded...

Please Sign in or register to post replies

Write your reply to:

Draft