locked
What is the best way to compact an LS solution for backup and transfer?

    Question

  • What is the best way to compact an LS solution for backup and transfer?

    As we are still working with prerelease code, I rely on frequent backups of LS solutions.  I am also moving solutions between machines and developers.

    Point being, we need the most compact way to store and transfer an LS Solution.

    I notice that the VS Clean brings my apps down to around 120 MBs.

    However, running a batch script that Oscar Ageda created for Beta 1 compacts the solution down to ~24 MBs which then 7Zips in less than 2 MBs.

    The Vision Clinic folder (ignoring the mdf and MHTML Documentation) is 112 MBs.

    Running Oscar's Clean.bat file reduced the pre-zip size to under 11MBs which 7zip'ed to a 1MB file.  The same Windows zip file compression was over 2MB.

    Therefore, I'd like to know what the best approach is for backup and transfer of LS apps.

    Tuesday, April 05, 2011 11:18 PM

Answers

  • This pretty much covers it. Thanks for sharing the script.

     

    Note that the database is not getting deleted which is what you want commonly. It resides under Bin\Data\.

     

    If you want to delete that as well, then you can run "rd /s /q Bin\Data\" after ensuring that no user file has been inadvertently copied into it.

     

    Another reminder - for the database deletion to work correctly, the solution must first be closed.


    Mohit Chakraborty
    Thursday, April 28, 2011 7:11 PM

All replies

  • Hi Garth,

    You can safely delete the bin\ and obj\ folders from the different projects in the solution to reduce the number of folders. The 'Clean' operation should already take care of all the files in there. Let me know if there are files left behind.

    The biggest benefits will come from the 'ClientGenerated' project deleting the different resource assemblies on 'Clean'.

    One thing to take care of is that you need to close the solution before deleting the bin\ folder under root.

     

    After that, you can use your choice of Zip utility to compress the solution and copy it for backup and transfer.

     

     

     

     

     


    Mohit Chakraborty
    Thursday, April 28, 2011 6:31 PM
  • Thanks, Mohit.
    Your note on closing the solution before running the bat file is very important.
    Oscar Agreda said it was OK to share his B1 LSClean.bat file with the community.
    Please review and let me know if you have any suggestions for improvement and/or caution.
    This file would normally sit on the directory below the app directory below the solution.   Some folks may want to put it at the same level as the solution and prefix the relative paths with the application directory.   I work with a lot of apps and prefer a generic bat file that works with all.
     
    rd /q /s Bin\Debug
    rd /q /s Bin\Release
    
    rd /q /s Client\Bin\Debug
    rd /q /s Client\Bin\Release
    
    rd /q /s Client\obj\Debug
    rd /q /s Client\obj\Release
    
    rd /q /s ClientGenerated\Bin\Debug
    rd /q /s ClientGenerated\Bin\Release
    
    rd /q /s ClientGenerated\obj\Debug
    rd /q /s ClientGenerated\obj\Release
    
    rd /q /s Common\Bin\Debug
    rd /q /s Common\Bin\Release
    
    rd /q /s Common\obj\Debug
    rd /q /s Common\obj\Release
    
    rd /q /s Server\Bin\Debug
    rd /q /s Server\Bin\Release
    
    rd /q /s Server\obj\Debug
    rd /q /s Server\obj\Release
    
    rd /q /s ServerGenerated\bin\Debug
    rd /q /s ServerGenerated\bin\Release
    rd /q /s ServerGenerated\bin
    
    rd /q /s ServerGenerated\obj\Debug
    rd /q /s ServerGenerated\obj\Release
    Thursday, April 28, 2011 7:00 PM
  • This pretty much covers it. Thanks for sharing the script.

     

    Note that the database is not getting deleted which is what you want commonly. It resides under Bin\Data\.

     

    If you want to delete that as well, then you can run "rd /s /q Bin\Data\" after ensuring that no user file has been inadvertently copied into it.

     

    Another reminder - for the database deletion to work correctly, the solution must first be closed.


    Mohit Chakraborty
    Thursday, April 28, 2011 7:11 PM
  • This is an excellent script. Many thanks to Oscar for writing it and Garth for sharing it!
    Friday, April 29, 2011 12:23 PM