During migration from DAM/QAM environments to Archive Shuttle, administrators may need to verify that all archived messages and collected items have been successfully processed. Inconsistent item counts between the QAM and Archive Shuttle databases can indicate incomplete migrations or data discrepancies that need investigation.
Discrepancies can occur when:
Not all mailbox items are included in the migration job.
Items were not correctly linked between the QAM and Archive Shuttle Item databases.
Collection or synchronization processes were interrupted or failed mid-operation.
Run the SQL queries below to gather and compare statistics from both QAM and Archive Shuttle databases.
DECLARE @mailboxIdArchives int = put_correct_mailbox_id_here
SELECT [t4].[MailBoxID], [t4].[value] AS [Count], [t4].[value2] AS [Size]
FROM (
SELECT COUNT(*) AS [value], SUM(CONVERT(BigInt,[t3].[Size])) AS [value2], [t2].[MailBoxID]
FROM [MessageFolder] AS [t0]
INNER JOIN [MessageData] AS [t1] ON [t0].[MessageID] = [t1].[MessageID]
INNER JOIN [Folder] AS [t2] ON [t0].[FolderID] = [t2].[FolderID]
INNER JOIN [Message] AS [t3] ON [t3].[MessageID] = [t1].[MessageID]
GROUP BY [t2].[MailBoxID]
) AS [t4]
WHERE [t4].[MailBoxID] IN (@mailboxIdArchives)
DECLARE @mailboxIdCollection int = put_correct_mailbox_id_here
SELECT [t0].[MessageID], [t4].[Size], [t4].[CheckSum], [t4].[NoPurgeBefore], [t4].[Subject], [t4].[DateSent], [t4].[DateReceived], [t4].[DateProcessed], [t4].[MessageDate], [t4].[DateModified], [t3].[FolderID]
FROM [MailBoxMessage] AS [t0]
INNER JOIN [MessageData] AS [t1] ON [t0].[MessageID] = [t1].[MessageID]
INNER JOIN [MessageFolder] AS [t2] ON [t0].[MessageID] = [t2].[MessageID]
INNER JOIN [Folder] AS [t3] ON [t2].[FolderID] = [t3].[FolderID]
INNER JOIN [Message] AS [t4] ON [t4].[MessageID] = [t0].[MessageID]
WHERE ([t0].[MailBoxID] = @mailboxIdCollection) AND ([t3].[MailBoxID] = @mailboxIdCollection)
select count(*) from Item where ContainerId = provide_correct_Container_id