+1-888-365-2779
Try Now
More in this section

Forums / Deployment / Copy Site from Production to Dev

Copy Site from Production to Dev

3 posts, 1 answered
  1. Emmanuel
    Emmanuel avatar
    3 posts
    Registered:
    19 Jul 2011
    01 Aug 2011
    Link to this post
    Hi Guys,

    Heres the situation.  I just inherited a Sitefinity website that didn't have a dev environment.  So I wanted to copy the existing site, database and the actual website.  I did exactly what I've read in the forums (i.e. 1. backup the database, restore it on my dev box. Copy the site to my dev box).

    I can tell that the site migration worked because I was able to bring up the site and everything looked fine.  But when I try to login to Sitefinity Admin site on my dev site, my login I used doesn't work anymore.  I cannot login as "admin" because my previous predecessor deleted that account for security reasons.

    I'm not using AD for the membership.  Im using what Sitefinity came with.  In other words, we created users and group and give groups access to pages.



    Thanks,
    Manny S.
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    01 Aug 2011
    Link to this post
    Hello Emmanuel,

    Please check whether you copied the files from App_Data/Sitefinity/Configuration. You can try to programmatically create an administrator.


    var userManager = UserManager.GetManager("Default");
    System.Web.Security.MembershipCreateStatus status;
    userManager.Provider.SuppressSecurityChecks = true;
    var user = userManager.CreateUser("user1", "user1234@", "user1@test.com", "Question", "Answer", true, null, outstatus);
    user.FirstName = "FirstName";
    user.LastName = "LastName";
    userManager.SaveChanges();
    RoleManager roleManager = RoleManager.GetManager("AppRoles");
    roleManager.Provider.SuppressSecurityChecks = true;
    var role = roleManager.GetRole("Administrators");
    roleManager.AddUserToRole(user, role);
    roleManager.SaveChanges();


    Greetings,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
    Answered
  3. Emmanuel
    Emmanuel avatar
    3 posts
    Registered:
    19 Jul 2011
    01 Aug 2011
    Link to this post
    Thanks that worked.
Register for webinar
3 posts, 1 answered