Al Nyveldt

Adventures in Code and Other Stories

This week, the Live Writer team released the first release candidate for Live Writer 2009.  The latest version has continue to build on the betas from the fall and is just a really nice blogging tool.  The update has a new look and bunch of new stuff you can read about other places, but I wanted to write about the new server-side tagging feature that is available for the BlogEngine.NET bloggers using 1.4.5.9 and beyond.

tags When using the newest Live Writer and a fairly current build of BlogEngine.NET you will get a new Tags entry box right next to the categories drop down.  While BlogEngine.NET users have always been able to enter tags in Live Writer using the Keywords box, the new box does a lookup as you type so you can see the tags you’ve already entered and select them from a list. Our complete tag list button is still available for viewing all your tags, but this new list is pretty handy. 

tagsinaction I really like the way the Live Writer team is pushing the API and allowing developers to enhance the Live Writer experience. If the cool stuff Live Writer allows your favorite blog software to do isn’t enough, there are 100s of plug ins that add even more functionality. I look forward to seeing what new functionality they offer us next.

paths Many moons ago, I asked for some testers for my BlogEngine.NET Provider Migration tool and I’m finally getting back to everyone with a tool you can use to move your BlogEngine data from one backend to another.  If you’ve been using XML and wish you could start using VistaDB, SQLite, SQL Server, or even MySQL, this is your chance.  If you started with a database and wanted to get back to XML, this tool should be able to help you too.  Lastly, if you are a database such as SQL Server and wanted to go the simplicity of SQLite, this process can likely help you as well.

The process is simple.  You configure the new provider you’d like to use.  The tool will copy most of your blog data from your current provider to another provider you select.  Once it is finished, you change your default provider in your web.config.  The process will leave your current data in place after it makes the copy so you will still have it in case something isn’t right.

You might have noticed I wrote “most of your blog data” above.  This is because the tool only transfers your blog posts, pages, settings, and ping services.  Widget data, extension data, and user data is not dealt with.  If you are transferring your membership and roles at the same time, you’ll need to set up your users and passwords again.

Full details on my Provider Migration Instructions and Tool page.  Good luck switching over.

Link: BlogEngine.NET Provider Migration Instructions and Tool

As you might guess, I get asked a ton of questions regarding BlogEngine.  My inbox is often overloaded with questions that I just don’t have time to respond to.  Anyway, I thought I might start answering the more frequently asked questions here in my blog.

A very common question is in regards to database setup and changing table prefixes.  I guess there can be different reasons for this, but the most common is when you want to have a second blog’s data stored in your database.

BlogEngine.NET is designed as a single blog system and if you want to have a second blog with it, you need to have a second folder with BlogEngine installed.  If you want to use a database for both, you will need two sets of the BlogEngine tables as they will not share one set for instances.  If you can make a second database, this solves that problem, but many shared hosting situations will only allow you one SQL Server database.

If you find yourself in this situation or one similar and want to get a second set of BlogEngine tables in your database, you need to modify your setup script changing the table prefix from “be_” to whatever you’d like your tables to be prefixed with.  Once you have the script modified, you can create your new tables with the new prefixes by executing the SQL script.

Now in your second blog’s web.config, you need to tell the providers to use the new table prefix as well.  This usually means updating the BlogProvider, MembershipProvider, and RoleProvider, unless you are using the database Membership and Role providers of course.

To do this, you will need to add the tablePrefix attribute to the providers as I did below.  AS you can see, I used the prefix “be2_” for this example.

   1: <BlogEngine>
   2:     <blogProvider defaultProvider="DbBlogProvider">
   3:         <providers>
   4:             ...snip...
   5:             <add name="DbBlogProvider" 
   6:                  type="BlogEngine.Core.Providers.DbBlogProvider, BlogEngine.Core" 
   7:                  connectionStringName="BlogEngine"
   8:                  tablePrefix="be2_" />
   9:         </providers>
  10:     </blogProvider>
  11: </BlogEngine>
  12: ...snip...
  13: <membership defaultProvider="DbMembershipProvider">
  14:     <providers>
  15:         <clear/>
  16:         ...snip...
  17:         <add name="DbMembershipProvider" 
  18:              type="BlogEngine.Core.Providers.DbMembershipProvider, BlogEngine.Core" 
  19:              passwordFormat="Hashed" 
  20:              connectionStringName="BlogEngine"
  21:              tablePrefix="be2_" />
  22:     </providers>
  23: </membership>
  24: <roleManager defaultProvider="XmlRoleProvider" enabled="true" cacheRolesInCookie="true" cookieName=".BLOGENGINEROLES">
  25:     <providers>
  26:         <clear/>
  27:         ...snip...
  28:         <add name="DbRoleProvider" 
  29:              type="BlogEngine.Core.Providers.DbRoleProvider, BlogEngine.Core" 
  30:              connectionStringName="BlogEngine"
  31:              tablePrefix="be2_"/>
  32:     </providers>
  33: </roleManager>
  34:  
  35:  
  36:  

If you’d like more details on the configuration of the providers, I wrote up a full post explaining them earlier this year in much greater detail.

Train tracks Well, a while back, I promised to release a method for helping people move their BlogEngine data from XML to a database or the other way around.  I gotten a lot of requests for this code, but I’ve been plenty busy with other things so it has just sat here until last week.  I cleaned up my code and I was surprised to see how little of it was left.  Anyway, I’m testing it now on my data, but I’d like to find a few more testers before I make it more widely available.

The method I use actually will move your blog data from any current BlogEngine BlogProvider data to another.  So you could potentially transfer from SQL Server to SQLite or from MySQL to XML as well as XML to some database.  It will leave your original data source intact of course, so the migration is actually a fine way to make a backup of your blog data as well.  The tool however is only for 1.4.5 users.

Anyway, if you are interested in giving this a try, leave me a comment below or send me an email.  Let me know what migration you are interested in testing (how your data currently is stored and what you want to convert to) in your message. I’ll pick a few testers, leaning toward those methods I want to see tested the most, and contact them with instructions in the next day or so.

Remember testers do not have to move to the new data source, it will just be making a copy.  You can chose to use that copy later, just delete it, or ignore it.  I just would like a few people willing to test and to get back to me with their results and feedback within 2 days of receiving it.  The process should take under 15 minutes.  (My blog takes under 3 minutes from setup to completion.)

If all goes well, I’ll get some feedback from the testers quickly and have the process available by the end of the week.

tools With a new release now available, I wanted to write up another guide for those looking to upgrade their blog.  The basic upgrade process is as always fairly simple, but I’m going to branch out and cover more special circumstances.  The guide might seem a bit long, but you aren’t likely to be concerned with all the steps. 

1. Backup

If you’ve read my guides before, you know I’m a big fan of the backup.  If you back it all up and something goes horribly wrong for you, you can just pop in back in place and start again.

I should note that I when I upgraded my blog to 1.4.5, I skipped most of this step.  I backed up my data and my themes and extensions.  Then, I just went for it and I felt bad knowing that I was going to tell everyone to back it all up.  So I’m confessing now as part of my guide that I skipped this.  I do however wish that I had a full backup.  (Not that I lost anything, but it would make for a great screencast to show you exactly how I upgraded my live blog.)

2. Download BlogEngine 1.4.5 (web)

If you haven’t already, now is the time to download the BlogEngine.NET software.  I recommend the web version as it is all ready to go.  Get it here if you don’t already have it.

Now that you have it, unzip it and remove the ready only check in the properties (apply to all subfolders and files).

3. Update your data and configuration

If you use the default XML data storage, you have nothing to do here as usual.  If you are unsure, you likely fall in this category.  Take a moment of silence for your database brethren and move on.

If you are using a database, then you have a little work to do.  In the Setup folder, there are 4 folders, MySQL, SQLite, SQLServer, and VistaDB.  If you are using on of these databases, open the folder, read the readme.txt file and follow the instructions.  There is an upgrade script and a sample web.config.

The web.config has changed since 1.4 and I would recommend you use the version included in the setup folder.  If you are using MySQL or SQLServer, you’ll need to move your connection string over as well. 

If you were using SQLMembershipProvider and SQLRoleProvider, you’ll need to configure these in your web.config.  To make things easier, we have made the dbMembershipProvider and dbRoleProvider, the default database options in our sample web.config.  I personally think the SQL versions are better options, but this is the easiest option for people to get setup and since the other database configs use them, it keeps things simple.

4. Update your web server

Now, we are ready start moving files to your web server.  You do have a backup you can be proud of from step #1 don’t you? If so, you can begin to copy your new files out to your web server.  It is always safest to remove all the folders and files you don’t want to keep before the copy.  For me, these means that I keep my app_data folder and remove everything else before I start my copy.  (I put my theme and extensions back at the end from my backup.)  This way you are sure you have removed all of the previous version.

Anyway, uploading your site will be the longest step of the process.  Be patient.

5. Security Thoughts.

If you are upgrading from BlogEngine.NET 1.4 and have converted to hashed passwords, you can skip this section, you’ve already dealt with it.  If you are using BlogEngine.NET 1.3.1 or earlier, pay attention.  We’ve upgrading the XMLMembership provider security to used hashed passwords by default.  This means if you are using the default security model, you’ll need to need to make some changes.  If you were using the SQLMembership provider, you can skip this as well.

If you fall into the category of people who need to make some changes you have 2 choices.  The recommended choice is to convert to hashed passwords.  To do this, you simply open your users.xml file (found in your app_data folder) and remove the passwords for each users.  (Don’t delete the whole password line, just the password, so that the it shows no password.)  Clearing out the password will allow you to use the password “admin” when logging in.  You should then use the Change Password option to change the password to a better password.  The new password will be hashed.

xmlpassword

Your other option is simply to continue to use clear text for your passwords.  To do this, open your web.config and find the Membership provider section.  You can change the passwordFormat from Hashed to Clear.  This option is not as secure and will require you to make this change with each upgrade of BlogEngine.NET in the future.

6. Themes and extensions

If you are using a custom theme by default, you will need to put this back in place before you try to browse out to your site.  If you are using special widgets or controls in that theme that depend on widgets, they will need to be back in place too.  The downside of putting them all in place before trying out the upgrade is they potentially could cause you issues.

Make a note of what files you are putting out on the web server in case you have issues.  If issues arise, you can simply remove these files and manually change your theme to “Standard” to test the BlogEngine setup.

7. Open your site in the browser

It will take a few moments for your site to come up the first time around.  If everything went well, you should see your blog as you remember it.  If you have an error or display issue, see the troubleshooting section below.

If you just did the security upgrade in step #5, log in right away and get those passwords changed from “admin” to something else.

8. Clean up

If you didn’t copy all your extensions out in step #6, now is the time to do so.  Copy them out, and refresh your browser.  It will recompile so don’t be shocked by the delay.

Now is a good time to check over your settings and make sure everything is coming up as you expect. 

Congratulations.  You are upgraded.

Troubleshooting

Don’t panic.

There are plenty of things that could be causing you minor issues that can quickly be corrected.  Here is a bullet list of things of things to check first.

Compile errors

  • If you are using a custom theme, widgets, or extensions, remove them, set your default theme to Standard, and try again.  You can change the theme in your settings.xml file or be_Settings table depending on your setup, xml or database.
  • If you are using MySQL, be sure to add the system.data section to your web.config.  (You can get this from your original web.config or from this post on the forums.)
  • Did you really clean out all the files (except app_data) or did you just overwrite them?  Did something get left over that is causing a problem?  Or did your FTP program miss some files?
  • Did you customize your web.config?  Try the one included in the download.  Using your old web.config will get you a nasty looking error.
  • If you are using MySQL or SQL Server, please check your connection string. 

Security errors

  • Can’t login?  Try clearing out your password as described in step #5.  If that doesn’t help, try using the downloaded users.xml file and logging in as admin.
  • An application restart might help out if you are really locked up.
  • If you are using a database and the default dbMembershipProvider, you can clear your password in the be_Users table and try logging in as admin.
  • Were you using the SQLMembershipProvider and did you configure it properly?  It is not a default setup.

Display errors

  • It has been reported that there have been some minor styling changes from 1.3.1 to 1.4.x.  Custom themes may require some minor css updates to get them working.  (I’m not sure what tags have changed as I didn’t have any issues with my custom theme in 1.4 or 1.4.5.)
  • If you have an empty widget bar, you will need to re-add you widgets.
  • If you just added the Administration widget and it shows up blank, refresh your browser and the options should show up.

Beyond these basics, I’d strongly recommend looking on the BlogEngine.NET forums and asking a question if you don’t see your answer after searching.  Please provide as much detail as possible in your forum post.  The forums are the best way to get help if you are having trouble.

About

BioPic Hi. My name is Al Nyveldt and I'm a software developer from central Pennsylvania, USA.

I'm on the BlogEngine.NET development team and write on a variety of development related topics. More...

Follow me on Twitter
Contact me via email

Recent Comments

Quote of the Day

"Do you see a man wise in his own eyes? There is more hope for a fool than for him."

- Proverbs 26:12

Sponsor


Recommended Books



Archives


Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2009

Sign in