11
Ok, try this:
Log in to mysql, then execute following:
select bid from (prefix)_newblocks
left join (prefix)_modules on (prefix)_newblocks.mid = (prefix)_modules.mid
where (prefix)_modules.mid is null;
If there is some output (unless it is 'Empty set' of course ;)), delete all the blocks from (prefix)_newblocks table with bids you got (delete from (prefix)_newblocks where bid=bid).
Then execute next select:
select (prefix)_block_instance.bid from (prefix)_block_instance
left join (prefix)_newblocks on (prefix)_block_instance.bid = (prefix)_newblocks.bid
where (prefix)_newblocks.bid is null;
and delete the blocks from (prefix)_block_instance with bids you got.
Do not forget to make backup first.