I have been charged with making a C# console application to do a daily migration of an Umbraco site from a developer site to a live site. The console application works like a charm, but the customer wants a button in the Umbraco backend where they could force the migration instead of waiting for the daily execution.
My question is this:
How would one go about making such a button. Is it possible to run a console application from the Umbraco backend or would I have to make it into a user control? Any help would be appreciated, and if you need more information just write a comment :)
I'm not aware of a way to run a console application from the Umbraco interface.
Possible solution:
Can the console application simply run every 10 minutes and check a value in the database? If the value is true, then do the migration and reset the value. This could be a date as well.
Then in Umbraco simply make a dashboard .aspx page with a button that says "Go Live" and that sets the flag in the DB to true.
Make sense?
This is my idea. I am not sure whether its correct or not . Please go through it.
In umbraco we can create a macro by using Asp.Net user controls. So in that macro put a button and in that button click i think we can execute the console application.
Related
I am trying to install Umbraco 7.5.3 on an empty project but the back office has no items in the menus. It doesn't also load anything in the content tree.
I tried to do a clean installation based on this article but it was the same.
I went with a clean web application, I even select .net 4.5.1 in a try, and in the wizard part, I went with custom installation and in DB part I've entered the SA account.
Ok, I made it work. It sounds a bit strange, but it worked! I don't know why it wasn't on the how to page. and I still don't know what could be wrong :|
I had to set up the site on IIS and then accessing it using the domain address that I created.
So if anyone has the same problem do this:
1- create a new website set the directory to your websites address
(yourdomain.com==> c:...\yourUmbraco project)
2- go to hosts file and add your domain
(C:\Windows\System32\drivers\etc\hosts)
add
127.0.0.1 yourdomain.com
3- give access to your app pool worker (or everyone in your risk :D )
4- access your backoffice using yourdomain.com/umbraco
i have searched on google without succses. I whis to display a custom page when i publish my website on iis 7. I know about the Offline.html or something like this. But i whant the process to be automatic on publish. Display a page like : we are upgrading the website, it will be avaliable in a minute.
Now when i publish my mvc site, it can take up to 3 minutes, it only display an error.
Tanks.
Ps: sorry for my bad english, it's not my first language.
You can create a file called app_offline.htm in the root of your site. If this file exists then its contents will be displayed instead of your site. You can then deploy your site, and then just delete or rename the app_offline.htm file when you are done.
I'm using Eclipse 4.2, appengine-java-sdk-1.8.9, gwt-2.5.1, smartgwt-4.0p
I'm trying make the simple project like this - http://uptick.com.au/content/create-gwt-project
but offline.
When I save page (as html page) it doesn't work offline and I receive alert - "GWT module may need to be (re)compiled".
My question is: how to change project to save it as html page (plus project_name_nocache.js file).
Thanks.
You might be getting this error message because you might be trying to run/debug your application in compiled mode. In order to do so, you need to re-compile your application for GWT after every single change in code.
To avoid this, you should run/debug your application in developer mode.
See this link, to have idea on how to run GWT application in dev mode.
Has anyone come across the problem whereby Umbraco says content changes have been saved successfully, you close everything down (including webmatrix), only to go back in and find that the changes have been lost?
I'm working on my localhost.
I think it's to do with caching of data on webmatrix, but I haven't a clue how you'd start up http://localhost:xyz without using webmatrix (if only to rule it out of the equation).
I believe when the message displays, the changes will be stored in database and next time you open your Umbraco for some reason, the XML file does not sync with database. In order to force it to be synced, simply delete the Umbraco.config file and restart WebMatrix and re-open the Umbraco.
The main advantage of using Webmatrix for Umbraco is it's IISExpress. So if you want to work with Umbraco without Webmatrix, add your website to IIS directly and since then you can have access to your site.
Seems to be a mystery problem still happening in SQL CE, for both WebMatrix and Visual Studio users alike. See the ongoing discussion in the umbraco issue tracker for more information at http://issues.umbraco.org/issue/U4-4621
The biggest thing I miss from Rails is the super handy console.
Let's say you need to call a certain function on the server that will update the database. In Rails, you just launch the console and call it.
In ASP.NET MVC I have to call it in a controller, rebuild the whole solution, transfer the compiled dll to the server, go to the page that has to call the function (it has to be protected of course), and it's done.
So is there an alternative?
Thank you
I don't know of anything like console for asp.net. But I do know of an alternative to what you're doing because I used to do similar things all the time.
You don't have to upload the newly compiled solution to the server. All you have to do is change your connection string from development to production. Then just run it locally and your production database will be updated.
To organize things a little better I had an admin page where I could do various database management tasks. I'd just create button links on the page for whatever it was I needed to do and all the actions were placed in an admin controller. I set the permissions on that controller so that only an admin could access the actions.
On a side note, why are you going from rails to asp.net MVC? I did asp.net for a few years and rails for a few months now. I find I prefer rails these days a lot more.
Edit: (if you need something quick and dirty)
add a button on one of your existing pages linked to a controller action
point your connection string to the production database
run locally and click the button
Afterwards, remove or comment out the code you just ran.
There is no console per-se built in in ASP.NET (although there is one in Visual Studio) but if your models are independent of the rest of the system you should be able to call them from a command line application (or even a Visual Studio unit test) really quickly.
LINQPad makes an excellent equivalent to Rails Console.. Instructions here:
https://stackoverflow.com/a/9403457/1029644