Forums

Skip Navigation LinksHome / Developer Network / Forums / Sitefinity Older Versions (3.x): Deployment > Copy Site from Production to Dev

Copy Site from Production to Dev

  • Emmanuel avatar

    Posted on Aug 1, 2011 (permalink)

    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.

    Reply

  • Answer Ivan Dimitrov Ivan Dimitrov admin's avatar

    Posted on Aug 1, 2011 (permalink)

    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

    Reply

  • Emmanuel avatar

    Posted on Aug 1, 2011 (permalink)

    Thanks that worked.

    Reply

  • Register for webinar
Skip Navigation LinksHome / Developer Network / Forums / Sitefinity Older Versions (3.x): Deployment > Copy Site from Production to Dev