Last post May 04, 2013 02:26 PM by Afzaal.Ahmad.Zeeshan
May 03, 2013 09:55 PM|mxbc|LINK
Is it possible to simply update--NOT overwrite--a CE .sdf-file-based database upon upload to the host production server after modifying it on a local development machine? Since it is simply a file, it appears that overwriting is the only option.
Here's the reason for my question:
In the website I have developed in WebMatrix, I am using a simple CE database with membership tables for user registration. The website will be going live very soon with just this simple database implementation. After it is live on the production server, users
will start registering for new accounts, thus populating the database's membership tables. However, while this is happening, I will need to continue development of the database on my local machine. For example, I will be creating new tables to populate a new
So here's the question: How do I update the database on the host server, such that my new product catalog tables are incorporated while at the same time not overwrite the user registration tables that are continuously being added to?
Any suggestions on the best way to accomplish this would be greatly appreciated. Thanks!
May 03, 2013 10:12 PM|wavemaster|LINK
There is no way to update the database. Making changes to the db and reconciling with a live site is cumbersome.
This is what I do. It is kind of Mickey Mouse but it works.
Create a page in the root of your site called app_offline.cshtml
<meta charset="utf-8" />
<title>yourdomain.com is currently offline for maintenance</title>
<p>Maintenance will start at 19:30 EST Wed Jan 30</p>
If the file is there the site is off-line. You can rename the file and it is online again.
I have a site which is my live site, then I have another site which is my test site. There I make changes to the db (while keeping a record of it)
I make changes to the files there as well. I test everything as much as I can.
1. take the site offline
2. download the db
3. make changes to the db
4. copy the files into the live site folder
4. publish the site
May 03, 2013 10:38 PM|mxbc|LINK
Thanks, wavemaster. I had a feeling there was no way to do this and had even already thought that creating a "Site Down For Maintenance" page and the procedure you describe might be the only workable solution. Trouble is, our company is a global one--my
night is some customer's business day--so any interruption of service this might cause would be an issue for them.
May 04, 2013 03:44 AM|Mikesdotnetting|LINK
You might be able to achieve what you want using Entity Framework migrations. http://msdn.microsoft.com/en-us/data/jj591621.aspx
May 04, 2013 02:26 PM|Afzaal.Ahmad.Zeeshan|LINK
1. Don't update every database (Or in other words whole site) in one moment.
2. Try to update one database, then other! This way less users will be prompted that the site's database is being updated!
3. Why not update the database with just one more table, First download the data (database ".sdf") then update the Database that you have, Now when you are doing this, prompt users that you are working, by showing them a page. Now after done! Update the
Database on hosting server!