none
Deploying list instances without overwriting existing list instances

    Question

  • hey there,

    I built a custom list definition based on a content type and created a list instance using the visual studio sharepoint tools.
    Everything works perfectly fine. However retracting the solution and re-deploying it always causes the custom list instances to be removed and re-created. It's not much of an issue in my development system as there is no content... but it's definitely nothing I want in my production environment!

    What's your approach to solve that problem?
    Do I need to create the list instances programatically (OnFeatureActivated?) and check if an instance already exists? Is there no declarative solution?

    Wednesday, March 14, 2012 12:59 PM

Answers

  • Well you can set the "deployment configuration" to "none" in your solution properties, with that it won't activate automatically your solution.

    your can to use external plugin for visual studio as the very good cks one. this one add some useful links like one to copy the assembly in the GAC and another one to copy files on the SharePoint Root . 

    With that if you are juste updating your code, you don't need to deploy the solution package again and again ;)


    Best regards, Christopher. Mon Blog My Blog

    Wednesday, March 14, 2012 3:11 PM

All replies

  • Hello,

    when you will update your solution it won't erase your list (do this test, deploy your solution via powershell, deactivate /activate your feature and check the result ) (I've just done it, my lists where still there and filled ;))


    Best regards, Christopher. Mon Blog My Blog

    Wednesday, March 14, 2012 1:23 PM
  • Ok I'll check that. Still... how am I supposed to deploy fromwithin  Visual Studio without erasing all my precious content again and again?
    Wednesday, March 14, 2012 3:05 PM
  • Well you can set the "deployment configuration" to "none" in your solution properties, with that it won't activate automatically your solution.

    your can to use external plugin for visual studio as the very good cks one. this one add some useful links like one to copy the assembly in the GAC and another one to copy files on the SharePoint Root . 

    With that if you are juste updating your code, you don't need to deploy the solution package again and again ;)


    Best regards, Christopher. Mon Blog My Blog

    Wednesday, March 14, 2012 3:11 PM
  • check this post

    http://sharepoint.stackexchange.com/questions/12208/updating-a-list-instance 

    maybe my development environment is customized for no erase (can't say, it's an old one ^^)


    Best regards, Christopher. Mon Blog My Blog

    Wednesday, March 14, 2012 3:16 PM