4

I have a couple of Composite C1 CMS websites.

To edit them currently I use the web based CMS on the live site.

However - I would like to update the (code & content) in Visual Studio locally - then sync to the web. However, if my local copy is older than that online (e.g. a non techy client has edited something on the live site) and I Web Deploy - it will go over the top of the new file on the server.

I need a solution that works out the newest change? I can't find anything in Google or the C1 docs.

How can I sync - preferably using Web Deploy. Do I need some kind of version control?

Is there a best practice for this - editing the live site through the web interface seems a bit dicey & is slow.

niico
  • 11,206
  • 23
  • 78
  • 161

2 Answers2

3

The general answer to this type of scenario seems to be to use the Package Creator. With that you can develop locally, add the files you've changed to a package, and install that package on a live site. This solution does not at all cover all the parts of you question though, and has certain limitations:

  • You cannot selectively add content to a package. It's all pages or no pages.
  • Adding datatypes is easy, but updating them later requires you to delete the datatype (and data), and recreate the datatype.

In my experience packages works well for incremental site updates, if you limit the packages content to be front end stuff, like css, images and such.

You say you need a solution that works out the newest changes - I believe the only solution to this is yourself, with the aid of some tooling. I don't think there's a silver bullet solution here.

Should you use a version control system? Yes! By all means. Even if you are not sharing your code with anyone, a VCS is a great way to get to know Composite C1 from a file system perspective, as you can carefully track what files are changed on disk, as you develop. This knowledge is crucial when you want to continuously add features the a website that is already alive and kicking - you need to know what to deploy, and what not to touch.

Make sure you read the docs on how Composite fits in VCS: http://docs.composite.net/Configuration/C1-and-Version-Control

I assume that your sites are using the XML data storage (if you where using SQL Data Store, your content would not be overridden upon sync).

This means that your entire web application lives in one folder on disk on the web server, which can be an advantage here. I'll try to outline a solution that could work for you, although I must stress that I've never tried this - I'm making it up as I type.

Let's say you're using git, download the site in it's entirety from the production web server, and commit the whole damned thing* to your master branch.

Then you create a new feature branch from that commit, and start making the changes you want to deploy later, and carefully commit your work as you go along, making sure you only commit the changes that are needed for your feature to work, to the feature branch.

Now, you are ready to deploy, and you switch back the master branch, and again download the entire site and commit it to master.

You then merge your feature branch into the master branch, and have git do all the hard work of stitching you changes in with the changes from the live site. There are bound to be merge conflicts, and that is where you will have to jump in, and decide for yourself what content needs to go live.

After this is done and tested, you can web deploy the site up to the production environment. Changes to the live site might have occurred while you where merging, so consider closing the site, or parts of it, during this process.

If you are using SQL Data Store i suggest paying for a tool like Red Gate's SQL Compare and SQL Data Compare or SQL Delta, to compare your dev database to the production database, and hand pick SQL scripts that can be applied to the production database along with your feature deployment.

'* Do consider using a .gitignore file to avoid committing certain files - refer to the docs for mere info.

Magnus Kragelund
  • 370
  • 2
  • 10
  • Thanks! To clarify & make this even more complex, there is custom MVC code in the site - edited by Developer (A). I am Developer (B) - I edit everything. There is also client (C) who is non techy but edits content and some markup. – niico Dec 03 '13 at 12:23
  • 1
    A small remark about exporting pages to a package :) The latest version of Package Creator (>= 3.5.6) now allows you to export "page trees", i.e. any page with all its sub pages. Right-click a page and select "Add this page Tree to package Creator". – wysocki Dec 03 '13 at 12:24
  • In my scenario I'm beginning to think editing the live site through the web interface (with regular, automated backups) might be the easiest approach? Going SQL is an interesting angle for content however. – niico Dec 03 '13 at 12:24
  • Could be interesting to use Git and have the website and your local site both be clients to your git repository. Some gitignores and then have the website automatic pull and checkin when changes are made to the files. Then we just need a notification system and a nice web based merge tool. – Poul K. Sørensen Dec 19 '13 at 09:38
1

I suppose you should use the Package Creator Also have a look here: http://docs.composite.net/Configuration/C1-and-Version-Control

xumix
  • 593
  • 7
  • 17