Copied to clipboard

Flag this post as spam?

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


  • Alan James 8 posts 27 karma points
    Dec 21, 2011 @ 06:51
    Alan James
    0

    Creating a 'boilerplate' Umbraco baseline install

    Hi,

    We are planning to use Umbraco for many website builds, and it would be a great timesaver if we could package up our 'boilerplate' requirements before we start the specific builds - for example have specific packages pre-installed, a set of Document Types and matching templates, macros, custom .NET controls, even some simple configuration things like turning labels on by default for TinyMCE content.

    My only thought how to do this at the moment is create it to the point I want it, then essentially publish that by copying the files / backup and restore the database.  Are there any other better ways of doing this?  I'm sure I can't be the first person with this requirement?  Are there any issues with doing an 'install' this way?

    Doesn't need to be exceptionally simple to do, just reliable.  Any advice greatly received!

    thanks

    Alan

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Dec 21, 2011 @ 08:07
    Jan Skovgaard
    3

    Hi Alan

    In order to setup a boilerplate, which you base all new Umbraco projects on you should consider to use source control like git or mercurial. By doing so you can keep track of your versions of your boilerplate and it'll simply be much easier to make changes, add new stuff, bugfix etc. and people on your team can all be contributing to it.

    Everytime you start up a new project you can simply just make a clone from the central repository and you're ready to go :) - I'll recommend that you base the boilerplate on SQL CE, since you can then just simply revert to another version if something is being messed up. When you're making a clone of the project to start up a new site then the SQL CE DB is easily migrated to a MSSQL server using WebMatrix.

    There is no issue doing an "install" this way. All you need to do when setting up your local development is to make sure that permissions on the umbraco root folder is correct (Tip: Set the permissions on a root folder containing all your umbraco projects - then they'll automatically be inherited once you setup a new project in there), setup a site in IIS and make sure the app pool is setup correctly and then setup a host name in your hosts file and you should be good to go. If you migrate the SQL CE DB then you must of course remember to edit the connection string in web.config.

    I hope this helps you a bit and provides some inspiration on how you can achieve your goal.

    /Jan

  • Alan James 8 posts 27 karma points
    Dec 21, 2011 @ 09:09
    Alan James
    0

    Great thanks for that, makes perfect sense.  So I'm best keeping the core boilerplate in CE then converting it?  All our sites are MSSQL, and we use VS rather than WebMatrix.  We do all our installs manually rather than use the installer.

    But once again great advice, thanks!

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Dec 21, 2011 @ 10:31
    Jan Skovgaard
    0

    Hi Alan

    You're very welcome.

    We don't use WebMatrix either - only to migrate the SQL CE DB to MSSQL - Since I'm a frontend guy I don't know what other tools are available but I've found that WebMatrix does an excellent job :)

    If you should use SQL CE for the boilerplate or if you should use MSSQL depends on your workflow I think. I can make sense to use if you are many people working on the bolierplate at the same time, since you don't risk data is overwridden when you pull. But I think it's a matter of workflow and what makes sense in that context - The benefit of using SQL CE is that you can easily revert to an older version of the DB if something is messed up. The downside is that some packages may not be compatible with SQL CE for instance.

    Once you have the boilerplate setup you don't need to run the installer - just clone, and setup the site in IIS etc :)

    /Jan

  • Sebastiaan Janssen 5046 posts 15479 karma points MVP admin hq
    Dec 21, 2011 @ 10:37
    Sebastiaan Janssen
    2

    FYI I version these things by scripting the MSSQL database to a SQL script instead of using SQL CE. 

  • Alan James 8 posts 27 karma points
    Dec 21, 2011 @ 22:01
    Alan James
    0

    I tried scripting it using the MS Database Publishing Wizard, but it didn't seem to work, I think it missed a few core objects.  I'd much rather have a script than a .bak file as it's much easier to version control for diffs.  Any recommendations for a successful way to fully script it?

  • Rich Green 2246 posts 4008 karma points
    Dec 21, 2011 @ 22:14
    Rich Green
    0

    Database Publishing Wizard works for me.

    You might also want to look at uSiteBuilder for a different way of setting this up.

    Rich

  • Sebastiaan Janssen 5046 posts 15479 karma points MVP admin hq
    Dec 22, 2011 @ 10:16
    Sebastiaan Janssen
    2

    The easiest way I've found to script the whole database was by just running this from a batch file, it has worked perfectly every time (you may need to fiddle with your paths a little):

    sqlcmd -S MyDbServerName -Q "TRUNCATE TABLE MyUmbracoInstall.dbo.umbracoLog"
    sqlcmd -S MyDbServerName -Q "TRUNCATE TABLE MyUmbracoInstall.dbo.ELMAH_Error"
    C:\"Program Files (x86)"\"Microsoft SQL Server"\90\Tools\Publishing\1.4\SqlPubWiz.exe script -d "MyUmbracoInstall" -S MyDbServerName -U MyUmbracoInstall -P blank0 -targetserver 2008 -f SQLScripts\setup_database.sql
    
  • Rich Green 2246 posts 4008 karma points
    Dec 22, 2011 @ 10:20
    Rich Green
    0

    Hi,

    Nice script Sebastiaan! 

    I can never work out how to install the Publishing Wizard if it doesn't get installed first time, I have it on my machine but on a dev machine it doesn't exist?

    Maybe something to do with only having SQL Express on the Dev machine. If anyone knows how to install it after the initial install or how to add it to SQL Server express I'd be grateful.  

    Cheeers

    Rich

  • jaygreasley 416 posts 403 karma points
    Dec 22, 2011 @ 10:50
    jaygreasley
    0

    Hey Rich,

    What version of Visual Studio do you have?

    I run 2010 Professional and if you go to Server Explorer, add  a new data connection if necessary (for sql express), expand the database and you get a 'publish to provider' option. This kicks off the publishing wizard. I don't think this works for a SQL CE db but for that you can use Webmatrix.

    I do like Seb's idea of running the cmd line publishing wizard in a batch file ( or a powershell script that deploys the whole site maybe?)

    Jay 

  • jaygreasley 416 posts 403 karma points
    Dec 22, 2011 @ 11:01
    jaygreasley
    2

    here's a link to the Publishing Wizard installer. I can't confirm it works as I already have it installed as part of VS2010.

    http://go.microsoft.com/fwlink/?LinkId=119368

  • Rich Green 2246 posts 4008 karma points
    Dec 22, 2011 @ 11:05
    Rich Green
    0

    Thanks Jay, I'll check it out.

Please Sign in or register to post replies

Write your reply to:

Draft