Backup before you startBefore working you may want to take a backup of the database tables under BAMPrimaryImport. Another option which I took instead was to modify the database table bam_Metadata_Activities in BAMPrimaryImport to a short time interval, then run the SSIS job which moves all the data to BAM archive. Doing this means the data won't be available in the BAM portal even though it's stored away in the BAM Archive, but also takes away the headache of dealing with partitions.
Unable to Configure BAM PortalIf you are unable to modify BAM Portal configuration because input is not possible like in the below window which shows we can't configure the accounts used for BAM.
Hit the button at the top to export the configuration. Modify the xml by removing all <Feature> elements except for <Feature Name="BAMPortal". Leave all the <InstalledFeature> elements. Now modify the elements under <Feature Name="BAMPortal" so that all the usernames, domain and passwords are set. In Biztalk Server Configuration, import this xml file. Click next on the following dialogs to finish.
Another option to try is to edit the BamConfig.xml file in C:\Program Files (x86)\Microsoft BizTalk Server 2010\Tracking. Turn element <GlobalProperty Name="BAMVRoot" into an empty element so as to get rid of your existing site. Then use bm.exe by bm update-config -Filename:BamConfig.xml.
Default Web Site is not validYou may also come across this problem where using the Default Web Site is not possible during configuration of the BAM portal.
You can try deleting the app pool BamAppPool from IIS and deleting any existing BAM website under Default Web Site then restarting the Biztalk Server Configuration tool. In my case this didn't solve the problem so I created another web site in IIS and used it instead of Default web site. This allows BAM to install in the new website. From there you can manually create the BAM application under Default Web Site by copying all the settings. This will allow the BAM portal to function under Default web site. Beware though that removing the other web site you created will cause the BAM portal under Default web site to stop working. So far I haven't been able to figure out where the connection is that requires the other website to stay functional.