Mac fix Outlook 2019 or Office 365 or corrupted database when repair fails and opens a new profile

Mac fix Outlook 2019 or Office 365 or corrupted database when repair fails and opens a new profile

During opening outlook 2019 on a Mac the SQLlite database that stores the message index information if corrupted will attempt to repair itself.

When this fails, it gives you the option to create a new profile, but offline emails stored in the main profile will get lost. Follow the recovery steps below

Run disk first aid

Run disk first aid on your hard drive to make sure there are no corruptions or problems. See https://support.apple.com/en-us/HT210898

Show the Library folder

The User Library folder is hidden by default in MacOS Catalina, MacOS Mojave, macOS High Sierra, and macOS Sierra, so first of all set the option to show the library folder.

  • From the Mac OS Finder, go to the Users home folder
  • Pull down the “View” menu and choose “View Options”
  • Choose “Show Library Folder” in the settings options for the User home folder
  • Show the user Library folder in MacOS
  • This is specific to each user account on the Mac, so if you want to reveal the user account on a different account you’d need to re-enable the same setting individually.

Duplicate the Main Profile 

  • Before attempting to repair or recovery, Duplicate the main profile folder just in case you need to use it after attempting other recovery methods
  • In finder browse to ~/Library/Group Containers/UBF8T346G9.Office/Outlook/Outlook 15 Profiles/Main Profile
  • Right click and duplicate to create a backup copy

Restore from timemachine backup

  • From timemachine first try restoring the sqlite database to see if this fixes outlook

~/Library/Group Containers/UBF8T346G9.Office/Outlook/Outlook 15 Profiles/Main Profile/Data/Outlook.sqlite

Otherwise try restoring the whole main profile folder

Recreate the email database

If you do not have a backup to recover from try dumping the database contents and recreating it.

  • Check the integrity of the database by opening a terminal and running

/usr/bin/sqlite3 ~/Library/Group\ Containers/UBF8T346G9.Office/Outlook/Outlook\ 15\ Profiles/Main\ Profile/Data/Outlook.sqlite “PRAGMA integrity_check”

  • use following commands to export data from corrupted database to dump.sql file:

/usr/bin/sqlite3 ~/Library/Group\ Containers/UBF8T346G9.Office/Outlook/Outlook\ 15\Profiles/Main\ Profile/Data/Outlook.sqlite

sqlite> .mode insert
sqlite> .output dump.sql
sqlite> .dump
sqlite> .exit

  • Move Outlook.sqlite to the bin (you have a backup copy just in case from duplicating above)
  • Create new Outlook.sqlite database. Run sqlite3 utility:

/usr/bin/sqlite3 ~/Library/Group\ Containers/UBF8T346G9.Office/Outlook/Outlook\ 15\Profiles/Main\ Profile/Data/Outlook.sqlite

sqlite> .read dump.sql

sqlite> .exit

Set the main profile as default and open outlook

  • From Finder, open the Applications folder.

  • Ctrl+click or right-click Microsoft Outlook, and then select Show Package Contents.
  • Open Contents > SharedSupport, and then launch Outlook Profile Manager.
  • set the main profile as default
  • open outlook

Try restarting your mac after doing the above if it does not work.