Sorry it has taken so long to get this posted. I actually had it completed several weeks ago, but learned a valuable lesson about writing a long article online using the r.a.d. editor. Part 3 of this series is migrating your data to a new DotNetNuke install. Please keep in mind that this is not a complete site migration, but more about creating a new DotNetNuke site and migrating your users and Active Forums from a previous install.
Step 1 – What do you have and what do you want to migrate?
For the new activemodules.com we wanted to start with a fresh DotNetNuke install. The only items we wanted to keep from the old site were users and data from Active Forums. We were going to create all new pages and content for those pages. This article will only cover migrating data relating to Active Forums. However, you could probably make some adjustments to migrate other data as well.
Step 2 – Build the site.
We built out all of the pages that we needed for the site and added modules where necessary. We even added an empty Active Forums module the new page where Active Forums would be loaded. This is a very important step as you will see later in Step 5.
Step 3 – Prepare old data for transfer.
With ActiveModules.com we had an additional twist. ActiveModules.com originally started out as a child portal with a portal id of 3. On the new site we had no intentions of ever installing a child portal and wanted to make sure ActiveModules.com was now portal 0. This was going to require making some modifications to the data in the old database. At this point we created another copy of our old database, just to be safe, and will use this database as the import source. Changing the portal id required making changes to data in several tables. The tables where you need to change the portal ID are listed below:
UserPortals
NTForums
NTForums_ForumGroups
NTForums_UserDetails
NTForums_ForumSubscriptions
Roles
RoleGroups
Step 4 – Migrating the data.
We used the SQL Server Import Export Wizard to handle the transfer of the data. Before you begin this step I highly recommend you backup the database on the new site incase any part of this transfer fails. The backup will give you the ability to restore and make adjustments without losing any of the progress you have made on the new site.
| Start the SQL Server Import Export Wizard and choose to transfer data from Tables. |
|
We need to specify the following tables for transfer: Aspnet_Applications Aspnet_Membership Aspnet_Profile Aspnet_Roles Aspnet_Users Aspnet_UsersInRoles Users UserPortals Roles RoleGroups UsersRoles ProfilePropertyDefinition UserProfile NTForums NTForums_Attach NTForums_Filter NTForums_ForumGroups NTForums_ForumGroupSettings NTForums_Forums NTForums_ForumsRead NTForums_ForumSubscriptions NTForums_Posts NTForums_Ranks NTForums_Read NTForums_Subscriptions NTforums_Templates NTForums_UserDetails ActiveForums_PollOptions ActiveForums_PollResults ActiveForums_PostRatings
|
 |
| We then need to check the column mappings for each table. We need to make sure we delete rows in the destination tables and make sure we enable identity insert with one with one EXCEPTION. DO NOT DELETE ROWS FROM THE NTForums table. This contains the module id for your new module instance and will need this later. |
 |
Step 5 – Getting your forums back on-line.
Now that all of you data is transferred, you have one last step to bring the forums back on-line. If you look at the rows in the NTForums table you should now see two instances of Active Forums. The first one is your place holder forum the second is from your transfer. Make note of the Module ID from the first instance and delete that row. Now change the ModuleId of the transferred instance to the ModuleId of the row you just deleted. Now you need to update a few other NTForums tables. You can use the queries below to make things easier. Make sure you change #NEWMODULEID# to the module Id of your forums instance.
REMEMBER: THIS IS ONLY IF YOU HAVE ONE FORUM INSTANCE
UPDATE NTForums_Filter SET ModuleID = #NEWMODULEID#
UPDATE NTForums_ForumGroups SET ModuleId = #NEWMODULEID#
UPDATE NTForums_Forums SET ModuleId = #NEWMODULEID#
UPDATE NTForums_Ranks SET ModuleID = #NEWMODULEID#
UPDATE NTForums_Templates SET ModuleID = #NEWMODULEID#
Once this is complete you should be able to login to your portal and verify all your settings. The first thing you should do is open the Active Forums control panel and click Update Settings on the main settings page. I would also recommend doing this for at least one forum group and forum to make sure the cache has been properly cleared and initialized.
Summary
Backup your database and backup often. Before beginning a project like this make sure you have a strategy and all the steps mapped out. Also you want to make sure you have plan incase the something fails along the way. Please keep in mind that the steps above are for moving one instance of Active Forums from a single portal. You can still use the steps above to move multiple instances, but you will need to make some adjustments to during the transfer process. If you need to complete a transfer like this by Monday morning, don’t try and pull everything together Sunday night, unless of course you have done a few test migrations first.