Update Database by republishing - database

this is my problem:
When working in webmatrix, if I have a published Umbraco site and I need to re-publish it to update the live version to my local version and I need to update the database too, I can't.
Webmatrix will say that the database file is in use. Of course it's in use, 'cause IIS is running on the server, and the site is live, so it's using its database, and it can't be overwritten.
What bugs me the most is that I haven't found any way to overcome this problem, if not by stopping my website's application pool on my server, or restarting the IIS service, but that's too much fuss!
There's got to be a simple way to update the database from Webmatrix.
I usually use a SQL CE database for my Umbraco websites but I can switch if SQL Server is needed.
Please, this is driving me nuts, I hope it's possible and someone will show me the way!
Thanks in advance

You could use the app_offline.htm method outlined here. Basically you can add a file to the root of the website called app_offline.htm and this will allow you to update the database. Obviously, you can format the app_offline.htm page to look like your site and have a some copy stating the site will be back up in a few minutes etc.
On a different note, moving the database to SQL Server causes a similar issue in that, although you can update the db without having to detach it, you still have to prevent people from accessing the site whilst the update is occurring.

Related

Is it bad practice to run an UPDATE script in Project Server

I am using the Project Server application which sits on top of a database. I have hundreds of edits to make to Project Server but It’s unrealistic to edit all of the Projects, one at a time. Instead of doing it one at a time, I was thinking of running an UPDATE sql script to write directly to the database.
Is this considered bad practice and would it break project server?
As soon as you do any writing on the DB by yourself or touch the schema you just lost your support from microsoft. They reserve the right to do any change in the db with each update.
Do not do it. Don't.
Use PSI or the REST API. Those are your friends.

How to add the connected SQL Server database to the solution folder?

I've created a small ASP.NET MVC application and used a SQL Server database. I saw that the database was not moved to the Solution folder, so if understood correctly, the application won't work on other computers/servers.
Is it possible to move somehow the database to the project without losing the connection with the application?
Please help! Thanks in advance!
Answer:
The problem was solved with the solution from
https://www.codeproject.com/Questions/441590/How-to-add-existing-database-in-app-data-folder-in
No. Seriously. ANY serious setup will have a database server and somone will apply a backup of the database you provide there. Unless you write toy applications, you NEVER employ the databsae on the same machine and "in the folder" - this works for development, it is not how SQL is deployed in the real world of larger controlled applications.
And get used on how to make upgrades to that database via some sort of change script mechanism.

Incompatibility Issues between Access Database Engine and Microsoft Access

I installed Access Database Engine in order to open a database using RStudio and everything is fine. However when I installed the package, Microsoft Access can't start which means that if I try opening any Access file or creating any new one, it won't open.
Therefore, there is incompatibility issue between Access file and Access Database Engine, since I tried this process on two different platforms and got the same problem. Therefore, I appreciate any ideas or solutions regarding fixing the issue using registry or other suggestions.
As Andre altready mentioned - there is a misunderstanding on your side. Access runtime can ONLY open existing databases for data entry, nothing else. No alteration of forms, no new reports, and especially no new table or database. For stuff like this you need the whole access application, which is part of office and far from free.

How to update an already published database?

I have a web application that has an SQL database.
For clarity I'm using Asp.Net 4.0/c#/SQL Server 2008 Web edition.
I recently puclished the site, which was my first, by creating a deployment package for the database.
Now a couple of months down the line, I need to update the database structure. The web application now has data that has been entered via the web, so i'll need to update the structure, then copy data across.
As this is the first time I've done it, I'm unsure of the process I should follow - is there a standard practice for this kind of update?
Also, since some of the tables use incremental ID's I need to ensure they remain the same in the newly updated database.
Any tips, links, advice appreciated.
Important Guidelines:
I assume you have not changed structure entirely (means keys column are same though solution is around for that too)
Steps are as follows:
Take export of the database
Add or remove the columns or whatever changes you want
Import the database back
Check the log for rows/tables (if some) were not updated successfully
Make SQL queries for them and run them to sync
Here are some general steps for this:
Take backup of your online database and restore it locally
Modify local database to suite your needs
Use third party comparison and synchronization tool to publish changes to your production database
There are many of these available and you can use them in trial mode to get the job done if you’re on a tight budget. You can try tools from Red Gate, ApexSQL, Idera, Dev Art and others…

uploading a realtime database into the web

Hi everyone I hav a small problem in uploading my database. I have created a localhost website on my pc for a vehicle tracking system and now i have no clue in uploading it. It's got two Microsoft Access databases in my pc which is used in the website and they get updated at very regular intervals(almost every second) it has to be uploaded to the web real time. Right now I use ODBC on a localhost..
Does anybody have any idea how to do it?
Please help if so...
Depending on your traffic using ACCESS in a webserver multi user environment will be a real pain. (File in access, etc). Perhaps try to build a webservice to make changes directly on the server?
If you don't want to use ODBC you may have a look at ADO connectionstrings (www.connectionstrings.com is a goot starting point).
I would concur with #Sascha I wouldnt even bother wasting the time trying to run your site with access.
Depending on your host you should have access to a free mysql or mssql database. Use this instead. Write a new page that takes parameters and writes them to your online database, that way you can set up a relay on your machine that pushes the changes from your local machine to the web.
This is definitely not easy, but it can be done. You would need to run a SQL Server database on the web server, and then push the data from Access to SQL Server, or pull it from SQL Server.
We've got a couple of links talking about it at SQLServerPedia:
How can I synchronize data between MS Access and SQL Server databases?
How can I link a SQL Server database to MS Access using link tables in MS Access?
Again, it's not easy - judging by the way you worded the question, you're not going to like the answers that you'll read about. You may want to bring in someone who's experienced with web-based databases and replication in order to bring you up to speed and set your expectations about how challenging this will be.

Resources