Database deployment from development to live - On Premise – Configurations & Setup - On Premise – Configurations & Setup - Progress Community
 On Premise – Configurations & Setup

Database deployment from development to live

  • Database deployment from development to live
  • Thanks to Josh Morales for his post about Sitefinity 4 Database Deployment when developing locally and deploying to a live shared hosting environment. That's a good overview of the options to transfer the database to a remote server.

    However, I still wonder how to do it when user data exists on the remote server. Many websites will have user membership data, forum posts, polls, etc. across various tables on the live server. That data is not available on the local development version and we don't want to loose it. It has been discussed before in this thread, but as far as I know, there isn't a procedure for this yet. Am I right? Is there any information available on how to facilitate this process? I guess it's a pretty common scenario.

    Thanks!
  • I'm glad you found the post helpful, and I'd like to see if I can help with your question. If I understand you correctly, your concern is with updating a live site, when the recommended path is to update locally.

    The way I have handled this in the past is to get a full backup of the live database, restore it into a local version of the site, then run the upgrade locally. If all is well, I then upload the updated website back to the live site and let it run the upgrade in place (because I know it works locally).

    of course I'd have one more backup of the live site before deploying, just in case.

    does that help any?
  • Hi Josh,

    Doing the upgrade locally is an interesting approach. I guess that might make it a bit less complex and risky. My main concern however, is that I have a website with user data which is being updated continuously. So, simply restoring a database I have developed locally is not an option as that will delete the user data.

    Currently, I am using only a fraction of Sitefinity 3.7 in just a part of my website. In the coming months, the whole site will be rebuild in Sitefinity 4.0. It will hopefully also include the Sitefinity forum module (assuming that it will be released in Q2).

    Now, the forum module is a perfect example: Let's assume someone wants to upgrade SF4 Q1 on shared hosting to SF4 Q2. The way I work, I would prepare the upgrade on my local development PC. I would probably not only upgrade SF, but also add content, change some of my user controls, custom classes, and do whatever else is on my to do list. Now I have a new version sitting on my local PC, which includes everything but the up to date user membership data and the forum posts.

    I wouldn't know how to proceed here. FTP'ing the new files to shared hosting is not the problem, but how to get the user data in the new version of my site? To make it even more complex: the schema of the database tables SF is using for the forum data may not even be exactly the same; Q2 may introduce minor changes to some tables that have to be configured in the life database.

    This is just an example. Perhaps I'm missing something obvious? I feel it can all get rather complex but may be it's not :-)

  • Hello AP,

    You could have several branches of the project and merge them. Upgrading a project should be done under dev environment only or if you have dedicated or virtual private server that you maintain.

    Greetings,
    Ivan Dimitrov
    the Telerik team

  • Thanks Ivan,

    I'll keep that in mind once I'm ready to perform such an upgrade.
  • This answer does not address the actual problems identified in the post. I have the same questions. I don't see how I can use Sitefinity 4 in a real production scenario until there is a good way to do upgrades and deployments on a live site that is in a continuous state of change.
  • The way I have actually done this in the past is to use  a tool like Red Gate Sql Data Compare or if you have at least the premium edition of Visual Studio 2010 you will have access to the database tools to also do DB compares or DB schema comparisons. 

    Below are the steps that I would normally go through when doing this type of upgrade.

    1. Take the web site offline by putting the file App_Offline.htm on the root of the site.
      a. This will ensure that nothing getting updated while you are doing the upgrade.
    2. Get a complete copy of the files and database back into development.
    3. Perform the upgrade to your Sitefinity site.
    4. Test the change in your DEV or TEST enviroment.
    5. Deploy the changes to your PROD enviroment.
    6. Remove the App_Offline.htm file from the root of your web site and you should now be upgraded.

    Also, if you are looking for a file comparison tool to compare files on your local DEV enviroment and the files on your PROD site, check out Beyond Compare 3.  You can find that at http://www.scootersoftware.com/.

    Just a word of caution, I have never done this for a Sitefinity 4 web site, but there is always a first for everything.  Enjoy!
  • Thanks Craig,

    I have RedGate SQL Data Compare as well. Good tool! Your steps are great for future reference. I'm still confused about which data from the sf_ tables to synchronize exactly though. I hope it will proof to be not that difficult once I reach the point of doing upgrades this way.
  • I would say, move all database schema changes and data up to PROD along with the web site files minus the database connection strings.  Just make sure you have the latest copy of your Sitefinity site copied down to your development enviroment before you start the upgrade.

    I am actually dealing with this same thing right now, and once I get the entire process mapped out I will make a blog post.  Hope this helps.
  • Thanks, I'm looking forward to your experiences.
  • We are having exact same problem here, as we have more than 10 servers (used for testing) so what is our option here if we have some changes in eg: Page structure or generic content. To do it by hand on all servers? What would be the list of sf_ tables we could script and deploy further? Please, any info would be helpful.
  • Hi ,

    -Use database replication and file mirroring tools
    -Replace the database directly on the production if you have dedicated server  - you can create a temp subdomain with the same project that will handle backup restore and database connection which would take up to 10 minutes. Then you can make schema comparison to fix some missing data.
    -use branches.

    There is nothing specific here, what would be the case of another web application if we put it in the same context?

    Kind regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  • Hello,

    It's 2.5  years later now, so I wonder what the answer would be if I asked the question at the top of this thread again. When 6.1 was being developed, I think I noticed a feature for this in the roadmap, but now that 6.1 is here I can't find it (at least not in the documentation, I have not upgraded from 6.0 yet). Assume a standard license, so without Site Sync.
  • Hi,

    You can transfer content with Site Sync. Configurations and users are still not covered by this feature.
    http://www.sitefinity.com/developer-network/videos/sitefinity-site-synchronization

    It's a long thread and I am not sure what exactly is the current issue. Please, let me know if you have a more specific question.

    Regards,
    Boyko Karadzhov
    Telerik
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items