I created an ASP.NET Core MVC code first project.
All works fine on LocalHost
After publishing it to Azure, most tables created fine, in some tables all the columns were not created and one table was not created at all.
Could it be that I deleted some of the migration files while still developing on LocalHost? Or does the Publish to Azure process create a new complete Migration?
How do I now get the latest version of my database, as I have on LocalHost, migrated to Azure?
There is no way to publish your application to Azure and the process of doing so to change the migration files generated by entity framework. Note that you need to create the database in Azure first then publish your web app.
My Db, Migration files and ModelSnapShot somehow went out of sync. I think I edited some migration files at some point.
Got it fixed in dev by deleting all migration files, dropping the db and then adding the migration again.
Related
I've a very simple application built in MVC4. This application allow the users to upload a file, and the application generates an output.
This app works great locally, but when I publish to azure (by right click -> publish), I get a less descriptive error. I've figured out that the error was because in the code, we accessed to a server relative path, and that is not possible in azure. So I've found a way to solve that in this link, that says that I should use LocalResource, rather than Server.MapPath. That make sense for me, but so far, I'm struggling with the suggested line.
LocalResource localResource = RoleEnvironment.GetLocalResource("DownloadedTemplates");
I'm not able to get it working, and also can't get a proper error. BTW I'm not sure how to enable the error log in azure :(
So, after going deeper in MSDN, I've seen that I should configure the Local Storage Resources, but as I've created a local MVC4 project, I can't find where I should configure this.
I need to be able to store a temporary file in the application (hosted in azure).
Did someone faced with this problem?
Anybody knows how to enable the Local Storage Resource in a project like that?
TIA!
Milton RodrÃguez
Well, after struggling a while, I've ended up using Windows Azure Tools.
The steps:
Add a new project
Under Cloud category, select Windows Azure Cloud Service.Note that if you don't have this option, an option to install the needed SDK will be shown. Install it first.
Name it properly :)
New Windows Azure Cloud Service window will appear, select the role that fits your needs. In my case, I choose ASP.Net MVC4, and then removed it.Note that you can edit the name of the created role at the right.
In the Roles folder of your new project, select Add, and then Web Role Project in solution. Your project will be an option to add.
You can remove the other role in the folder, the web project created in step 4, and also the folder ending in Content (ie. WebRole1Content). Basically, you can remove the created assets, but the Azure Service, and link the service to your project.
You're almost done. Follow this link to configurate your local storage :)
Now you're done!
Can anyone say if there is a complete/accessible API for the latest Azure bits that will allow the complete creation (not just scale out like Scale Windows Azure roles programmatically) of a 'worker role' application? Not building a web site or needing any SQL or table storage. I would like to build an EXE that will create the full container and allow the upload of DLL/config artifacts so the app will exist and start up.
Thanks.
I'm not sure this completely solves your challenge, but... Take a look at these PowerShell cmdlets:
New-AzureServiceProject
Add-AzureWebRole
Add-AzureWorkerRole
They will spin the scaffold code for your web and worker role, respectively, and optionally allow you to specify a template folder.
The Operations on Hosted Services page should get you started. Specifically you'll want to Create a Hosted Service if you don't have it already, then Create a Deployment. You'll have to point to a deployment in blob storage that you've uploaded in order to create and then start the deployed instances.
I've successfully created site using Umbraco now its time to upload it on hosting server..
i've searched and got one paid product for the same..and i dont want to use it.
Has any body tried developing Umbraco site on local and then uploading it on server?
If yes then please help me doing that.
First I run the umbraco install from a local IIS website. Then I setup my visual studio solution for that website (and my souce control). Then I work, until I reach a beta version, then I go through this process for deploying:
Ftp over to the remove website and copy the whole website (I actually use Beyond compare).
Connect to my local database with management studio and create a .bak file.
Upload the .bak file to the database server.
Restore that database
Review connection strings in web.config
Then I'm pretty much done.
Once I'm "live" and have content I don't want to lose, when I want to work on the website, I bring back the live database through a .bak file, then I make my changes. They often include DB changes since the schema is basically in the database. I note all the operations I do. Once my changes are ready I manually replicate the changes on the live site as I update the files.
This is very painfull but I tried solutions like courrier and other things like that and they are not reliable enough for production I find. Manually is the only risk free way I see for the moment.
Hope this helps.
Yes, that happens all the time. Use FTP to copy your local installation to your webserver, modify the web.config to point to the correct database and your website should be up-and-running.
I'm sure there are more elegant solutions with less clicks but here's how I do it on azure websites with sql, not sure what hosting/db you're using:
1) Create an empty db on azure with the same login and user as my local db.
2) Create an empty site on azure connected to my db.
3) Download the publishing profile.
4) Upload the db the first time with Sql Azure Migration Wizard.
5) Import the publishing profile into and upload the site with WebMatrix.
6) Thereafter I deploy the site and db with WebMatrix.
WebMatrix uses WebDeploy or FTP, you can use WebDeploy through IIS if you like, and FTP.
Recently my Windows Sharepoint Services 3.0 server went down, and all I have is the mdf and ldf. Am I correct in assuming that the aspx files are embedded in these database files? I have attached the db to a local sql, and have access to it. However, I need to access some of the aspx files that were created in sharepoint. How do I go about extracting these files? I've been using MS SQL Manager Studio Express to sift through the data. However, the ASPX pages that have the real content (not the structure of SP) is needed.
Thank you
Yes, all your content is in the content database. Don't bother trying to pick apart the database structure - there is an easier way:
You will need a WSS 3.0 farm, perhaps a clean install on a new machine. Then attach your mdf/ldf files in SQL Server (use Management Studio or T_SQL). Then create a web app in WSS and attach the database to the web app in SharePoint Central Administration. You will probably also need to change the site admin in Central Administration. You can then go back into your site and get at your aspx files.
You need to restore your site from the database. There is no need to extract files from the database. Once you set up a site, all content will appear again.
I haven't done this for some years, but articles like KB 833797 show you the basics
It's also effectively the same as a SQL Server migration so this too
And some Google links
I have an active sharepoint farm already built and I am wanting to create an exact mirror copy of the sites and all its contents into a different domain for develpoment and testing. The share point site is live and can not be brougt down I have tried using sharepoint designer to migrate the sites but this comes up with a multitude of errors. I have also looked at stsadm.exe but I am not sure what commands i need and can I use this on a live site.
I have also tried the inbuild backup restore tool within sarepoint but this sill comes back with an error. I am using sharpoint office 2007 with sharepoing central admin 3.0.
Thanks
Andy
It is possible to create a "live" backup of the content database in SQL level (do not try to move configuration database). This can be don by SQL management studio.
Then copy it to the other domain, restore SQL database and attach it to sharepoint.
Do not forget to stsadm -o migrateuser -oldlogin <DOMAIN\name> -newlogin <DOMAIN\name> [-ignoresidhistory] to migrate the users.