7

I am in the situation where I have been charged with making an application or extension to Umbraco that makes the backend users able to do a migration of their changes on the development site to the live site. This migration is supposed to happen once a day, or when the backend users press a button in the backend.

I am aware that Umbraco offers this in the Courier package, but apparently it doesn't work well enough for this case.

A few more details:

The development and live site both reside on the same server and so do their databases. The data will simply need to be transferred from one folder to another and the same with the tables in the database.

As I can see there are two methods of going about this.

1) You do a full migration, where you basically do a teardown of the live database and update it to the new version. You then copy over all the files you need as well.

2) You create a package containing the document types and so on you have changed on your developer site and load that package on the live site.

The problem with number 1 is that it seems you have to republish the entire site when you have done the transfer. As far as I have understood you can do this with a webservice, but I would prefer it if I could use a console app instead.

My question is then:

Is there a way to create packages programmatically and load them in the same way or what would be the best way to achieve this migration programmatically?

Any suggestions would be much appreciated as I am kind of at a loss for a way to do this :)

EDIT

I ended up actually doing a complete mirroring in the sense that I used Robocopy to transfer all the files that had been changed in the folders, and then I did a backup of the development site with a SQL command, and then I restored it on the live database using the RESTORE SQL command.

A few settings needed to be done in the SQL commands, but it runs smoothly and a complete transfer takes down to 10 seconds depending on the number of files that have been changed.

One last thing. If you want the changes to be visible you need Umbraco to be reloaded. This you can do by modifying the web.config file, either manually or by setting it's LastWriteTime programmatically.

Kasper Vesth
  • 4,103
  • 1
  • 37
  • 31

1 Answers1

4

You can always create a usercontrol that will handle the republishing of the entire site for you, this you can call from your console app.

You could also join the Courier 2 beta program, which is indeed good enough (for features anyway, I haven't tested it myself).

Another route could be to offer all of the nodes as a xml feed and use the scheduling feature of CMSImport to migrate nodes automatically.

This is a tough one, there's a lot of options an no silver bullet yet. I have good hopes that Courier 2 will be perfect for this and am eagerly awaiting its release.

sebastiaan
  • 5,870
  • 5
  • 38
  • 68
  • But how would you handle the migration of the nodes in the database? Just if others are looking at the answer, you would need to keep track of the id's of the new pages so you don't accidentally publish pages that you don't really want to have published, if any such exist. – Kasper Vesth Apr 27 '11 at 14:08
  • You start with 2 identical databases. Then when you put 1 of them in a live environment, reseed all of the tables that will change (sorry, don't know which ones will change) to start with a really high seed. Existing content can then be overwritten (same ID) new content on the source database can be copied over without interfering with existing content. – sebastiaan Apr 27 '11 at 14:14
  • FYI: I've been looking for the silver bullet and this is as close as I got, it is simply very very hard to do this in Umbraco and I don't know of many people that have a succesful automated strategy. Courier 2 is supposed to make all this really really easy. – sebastiaan Apr 27 '11 at 14:15
  • Let us pray that it will relief us of our problems hehe. Anyway thank you for your answer, I will consider it the correct answer for my question and mark it as accepted :) – Kasper Vesth Apr 27 '11 at 14:24