Add a New Blog to Multi-Blog
There was a script created for SqlBlogProvider that emulates that portion of the SQL Setup script for “standard” BlogEngine.NET. I actually modified it several times and realized that I don’t like that approach as much as anyone, but had to take time to build a UI. Almost as hard as it is to select a name for a new project in Visual Studio, I had to think about how I wanted to access this maintenance utility. The first approach, basically where I am now, was to whip up a prototype in a Windows form, using a separate class (library) for the functionality, accessing the database via the same Linq2SQL provider. It worked, of course, but it’s not a perfect solution by any stretch.
Can anyone identify the correct answer or perfect solution?
Maybe not, but for “our” purposes it means the one that helps everyone or “most” everyone who will use this approach.
So who is “Everyone?”
We are the people who want to use BlogEngine.NET for its ease of use, intuitive and extendible architecture, and add on the multi-blogging capability. We are NOT a group of perfectionists, or corporations with bottomless pockets, nor are we people who are happy to blog all day, everyday on a single blog. We are also those who may want to rip any solution apart and improve it for our own needs…again, basically where I am today.
How to add a new blog, manually:
First you need to execute a script or add rows to several tables by hand. “BlogEngine Multi-Blog Dog Food” contains the SQL script “AddNewBlogHost.sql” which can make it easier to add a new Blog and Host to your multi-blog environment . Again, this is not the ideal solution, but the winform code has yet to be tested thoroughly. I’ll post it next chance I get anyway.
What else you need to know:
BlogEngine.NET relies on creating an application and folder for each blog you host on IIS. If you were hosting multiple applications on a single server, you would find yourself with ‘n’ application folders, with ‘n’ sets of code/files, with ‘n’ times the maintenance. And if you also add SQL server, you could have either ‘n’ databases, or ‘n’ sets of tables, where ‘n’ is the number of Blogs you want to maintain. For one or two blogs, this is hardly any concern at all.
When you start maintaining 7, 8, 9… 12+ blogs, this becomes a full time activity to maintain…or just hope for the best that BE.NET was perfect the last time you updated so there won’t be any need to worry for a while. :) There were other problems, such as the cost of resources when running all those tables or separate databases. I had to stick with XML due to memory limitations.
Now: One folder, one set of binaries, one set of widgets/themes/extensions, One database and a single set of tables, but I still need to create a separate IIS Application pointing at that one file folder for each blog. Each application has its own host header configuration that is mirrored in the Hosts table.
If anyone has the patience to try this out, please let me know any pitfalls or problems, suggestions, hints, missing or redundant parts. If there’s enough interest and anyone willing to help, we can start a project and maintain this until the BlogEngine.NET team wants to take it, invite us to branch the source, or decides on some other course of action that renders this obsolete. I’ll be working on a completely separate Blog / CMS application unless I find one I really like in the meantime.
And Yes, I would be happy to contribute to BlogEngine.NET if someone ever took me up on my several offers.