Orchard Core CMS Export/Import Content Type and Part definitions and Content Items - orchardcore

I've created an Orchard Core site on my local machine using a local SQLite db. I now want to publish this site to Azure and use an Azure SQL DB for the data. I'm told the easiest way to achieve this is to create a new site pointing to an Azure SQL db via the setup and then publish this.
But, what about all the type definitions and all my content. Is there a way for me to export this out of my local SQLite version and import it to my new Azure SQL db?

How to manage your content definitions is part of the Orchard Core documentation here
https://docs.orchardcore.net/en/latest/docs/guides/content-definitions/
You can choose to use either the File Content Definition Store, or the Database Content Definition store, and you can then use the Import / Export feature to create a deployment plan with both your content definitions, and content, to export to either a file (and then import on the Azure server), or directly by configuring a Remote Instance Target

Related

Publish ASP.NET project with local data on Azure

I'm quite new to ASP.NET and I encountered a problem when publishing my project to Azure. After configuring the connectionStrings in Web.config, I have successfully uploaded my local database structure to Azure. However, all tables on Azure are now empty, without any local data. So how can I upload both the database structure as well as the data in it? Thanks in advance.
To migrate an existing SQL Server database to Azure SQL Database you can export the schema as a TSQL script and then execute that script against Microsoft Azure SQL Database as follows:
1.Open SQL Server Management Studio and connect to an instance of the Database Engine.
In Object Explorer, right click a database to open a menu, select Tasks…, and then select Generate Scripts.
2.Choose objects to export.
3.Set scripting options. You have the options to save the script to file, clipboard, new query window; or publish it to a web service.
4.Set advanced scripting options.
You can also set the Types of data to script to one of the following based on your requirements: Schema only, Data only, Schema and data.
5.After the script is created, you have the option to modify the script before running the script against an Azure SQL Database to transfer the database.
You can now run this script on your Azure SQL Database.
For more details, you could refer to this article.
You have to create a post deployment script. If the tables are created just fine on your azure application, then you must define what default data they will have. So in your post deployment script you will insert the data you want.

How to Connect Kentico Website with database

I just started working with Kentico and after Kentico Installation there is no setup files for my sql server database but I get the files are locally stored in the database(on localdb). So now I want to know that how can I connect with the existing database(sql server). As I try to change the web config but there are issue when we run the service from Kentico Service Manager.
Also I am having an another issue that how can this be possible with kentico that if the admin made certain changes in the text through interface and those changes should be reflected in database as well.So that next time when anybody tries to access the website it will reflect to him. Please let me know about it. Thanks in advance.
Please, refer:
Connecting your project to the database
Daabase Setup
Managed projects are connected to the database and contain Kentico EMS data by default.
If you're using an unmanaged project, you must connect the project to the database manually. You have two options to connect your project to the database:
entering the database credentials into the database setup wizard
adding a connection string to your application's web.config
Connection string template
<add name="CMSConnectionString" connectionString="Persist Security
Info=False;database=DATABASE_NAME;server=SERVER_NAME;user
id=USER_NAME;password=PASSWORD;Current Language=English;Connection Timeout=240;"/>

How can I implement a local testing database for my Azure Website?

I have a website I'm developing that uses an SQL Azure database. I want to be able to test my website using a database locally hosted on the debugging machine so that my designer can work on style and content without having to deal with the overhead of firing up the Azure emulator and communicating with an external service as he is often in areas with no-connectivity.
I imagine it would be possible to extract the .sql scripts to create the database and execute them every test run, but this seems tedious. Similarly I'm not sure what the best way to configure these deployment details would be in order to switch between development, and published configurations. I'm a new web-developer cutting my teeth on a rather large project.
Using ASP.NET MVC4 and have MSSQL 2012 installed for what it's worth.
You can export your SQL azure database as .bacpac format and then import it into your sql server database. It will create all tables and fill with data. You don't need to do it on every test run, just do it once and you will have proper database for debug needs.
Switching between debug and release (or you can rename it if you want, e.g. Local and Production) configurations and using different web.config (or config transformations) is a good way to work with different settings.
If you want to store your db scripts (db structure or data) in your VCS - you can use Entity Framework migrations (new fancy way) or separate project of "SQL Server database" type (old school but proven way :) ).
Also EF migrations allows you to easily recreate db (with different name) on each run (for unit testing purposes. And then you can use SQL Express file instance (keep in mind that it's only for local work, your designer wont be able to access sql express instances afaik)

Setting up Orchard development workspace

I'm just learning orchard CMS, and have some questions:
How do I setup development environment for the team? should I use source code of orchard itself (I don't want that) or is there a way to use Orchard in compiled state?
I would prefer each developer to have its own local copy of DB, won't it make troubles for the team when they get sources and need to go in admin mode and manually execute updates on modules?
For development you should definitely set up full source enlistment. Using the compiled, deployment package (as can be downloaded from Codeplex or via WebMatrix) will drive you in lots of problems.
Orchard can run on either "normal" SQL Server or SQL Server Compact (single-file) databases.
What do you mean by a "local copy of the DB"? Each developer can test his instance using local SQL Server CE database - it's how I usually do that when working on custom modules.
If you have some preconfigured database you'd want your developers to use (because eg. it contains some sample data, themes setup and such) - each developer can copy the database from the server to his own, local SQL Server CE-based database. Migration can be easily done from Visual Studio, SSMS or WebMatrix.

How to create database file into msi file for clickonce

I am developing a CMS based application and I want that my application should install the database automatically while installing the application. How can I create a MSI file so that I can install my database automaitcally on startup.
You can either
1) include the .mdf/.ldf files for an "empty" database into your MSI and place them in the right directory for SQL Server and then use e.g. sqlcmd.exe to attach those database files to the server
OR:
2) you could include a bunch of scripts to create this database into your project, and have some utility (e.g. SSW's SQL Deploy) execute those scripts in a given order, to create the database, database objects, and seed the lookup / system tables
OR:
3) you could look into Microsoft's new WebDeploy technology - it allows you to deploy a web app including stuff like IIS configuration and database scripts to a new machine.
Web Deploy 2.0 Home Page
Web Deployment Made Awesome: If You're Using XCopy, You're Doing It Wrong

Resources