Export site template functionality?
I read in the following post (made in 2008) that a future release of Sitefinity will contain functionality allowing a site template to be exported (pages and content) from one site, and imported into another Sitefinity site.
http://www.sitefinity.com/devnet/forums/sitefinity-3-x/developing-with-sitefinity/migrating-from-mssql-to-mysql.aspx
I am wondering if this functionality is currently in place? I am in a similar situation, but I am attempting to migrate a Sitefinity MySQL database into MSSQL (without any data loss). The site should appear the exact same after the transition, with no noticeable differences to the user.
What are the best recommended practices for performing this type of migration? Has anything changed since 2008 when the above post was created? I could see issues arising using third party tools to perform the migration, due to the differences between column data types for MySQL and MSSQL, and what Sitefinity expects to find.
Thank you,
Chris
Hello,
To set the Sitefinity configurations you should fallow these steps:
1. Go to your project in Visual Studio.
2. Expand App_Data file tree.
3. Expand Configurations file tree.
4. Select DataConfig.config and change the field dbType="MySql" to dbType="MsSql".
As for the migration from MySQL to MSSQL, you can read the fallowing articles:
http://www.codeproject.com/Articles/29106/Migrate-MySQL-to-Microsoft-SQL-Server
http://www.aspfree.com/c/a/MS-SQL-Server/Convert-MySQL-to-an-MS-SQL-Server-2008-Database/
Another solution for your problem is to use our Pages API for all of your templates, for example look at the source code bellow:
var template = pageManager.GetTemplates().Where(t => t.Id == templateId).SingleOrDefault();
Thank you for your response Stefani, however, the main issues I have been running into deal with converting the migrated MSSQL database result into the same structure that Sitefinity expects to find. More specifically, the issues I have been seeing are related to column data types not matching up (causing invalid cast errors when loading the site), constraints not being setup correctly, etc... after the migration has been completed. I've attempted to run through and make these updates manually, but the only way I have found to detect and debug the differences is to load the site and see what fails. This is just not a good strategy and will likely not yield a working solution.
Do you have any other tips on how a Sitefinity MySQL database can be successfully converted to MSSQL? I have seen a lot of people post about using third party tools to handle the migration, but I have not seen any one describe what needs to happen after the migration completes in order to make sure those table structures are correct. I appreciate any advice or recommendations you can give on this matter.
By the way, I used "Microsoft SQL Server Migration Assistant for MySQL" to perform the migration.
Thanks again,
Chris
That brings to mind another question. Is there any place I can go to download a complete and empty Sitefinity MSSQL database, containing all tables?
Hello,
Actually we have a tool, which might help you migrate only your site content, without users and configurations. It is called SiteSync. You can take a look at our Sitefinity documentation.
You can also find this article useful for your scenario. It is a Microsoft tool that may help you to migrate your database.
Unfortunately, it is not possible to download a complete and empty Sitefinity MSSQL database, because OpenAccess creates a database run time when you create a new project. If you want an empty database, you can create a project and it will automatically create it.
Greetings,
It looks like the SiteSync tool can only be used with an Enterprise license (or Professional with purchase of the add-on). Are there any other options for accessing the SiteSync functionality?
Hi,
As you noticed SiteSync tool can only be used with an Enterprise license or Professional with purchase of the add-on. Unfortunately we do not offer any other options of using SiteSync. I am sorry for the inconvenience. You could try the Microsoft tool I have wrote you about.
If you need any further assistance, feel free to write back.
Greetings,
Stefani Tacheva
the Telerik team
sorry to highjack but is there anything to export pages, templates into a file like there used to be? as described in this article: http://blog.alanta.nl/2010/10/moving-sitefinity-site-into-another.html
Hi,
In Sitefinity 5.0 we do not offer to export the site as a template for other sites.
However, if you want to get the HTML of one page you can try to use the following example:
protected
void
Page_Load(
object
sender, EventArgs e)
var myPages = App.WorkWith().Pages().ThatArePublished().LocatedIn(Telerik.Sitefinity.Fluent.Pages.PageLocation.Frontend).Get();
foreach
(var page
in
myPages)
var pageHtml = RenderPageHtml(page);
public
string
RenderPageHtml(PageNode pageToProcess)
var myPage = App.WorkWith().Page(pageToProcess.Id).Get();
var myPageRenderer =
new
Telerik.Sitefinity.Web.ResourceCombining.InMemoryPageRender();
return
myPageRenderer.RenderPage(myPage);
Hi Chris,