{"id":295,"date":"2016-04-25T11:31:31","date_gmt":"2016-04-25T17:31:31","guid":{"rendered":"http:\/\/www.cortig.net\/wordpress\/?p=295"},"modified":"2017-05-16T08:13:30","modified_gmt":"2017-05-16T14:13:30","slug":"outlook-2016-sqlite-database-commands","status":"publish","type":"post","link":"https:\/\/www.cortig.net\/wordpress\/2016\/04\/25\/outlook-2016-sqlite-database-commands\/","title":{"rendered":"Outlook for Mac 2016 database basic sqlite3 commands"},"content":{"rendered":"<p>Outlook 2011 had a proprietary database format and we (as users) had very few options to work with it.<br \/> Outlook 2016 now uses a sqlite3 databases for its identity (just like Mail).<br \/> While there is very little we can run from the app itself in terms of maintenance or troubleshooting, in theory we should be able to tap straight into the database through sqlite3 itself.<\/p>\n<p>*********\u00a0NONE OF <span class=\"caps\">THIS<\/span> IS <span class=\"caps\">PUBLISHED<\/span>\/APPROVED\/SUPPORTED BY <span class=\"caps\">MICROSOFT FOR OUTLOOK FOR MAC<\/span>\u00a0*********<\/p>\n<p>As none of this is officially supported, I would recommend<br \/> 1) <strong><span class=\"caps\">BACKUP<\/span><\/strong> the database before anything.<br \/> You need to backup the three files:<\/p>\n<ul>\n<li>Outlook.sqlite<\/li>\n<li>Outlook.sqlite-shm<\/li>\n<li>Outlook.sqlite-wal<\/li>\n<\/ul>\n<p>That are in the <em>~\/Library\/Group Containers\/UBF8T346G9.Office\/Outlook\/Outlook 15 Profiles\/Main Profile\/Data<\/em> folder.<\/p>\n<p>2) <strong><span class=\"caps\">QUIT<\/span><\/strong> Outlook. You can&#8217;t run anything safely on the identity if it\u2019s still in use in Outlook itself.<\/p>\n<p>\u2022\u00a0You can check the integrity of the database with the command:<br \/> (triple-click the command to select all, then copy)<br \/> <code>\/usr\/bin\/sqlite3 ~\/Library\/Group\\ Containers\/UBF8T346G9.Office\/Outlook\/Outlook\\ 15\\ Profiles\/Main\\ Profile\/Data\/Outlook.sqlite \"PRAGMA integrity_check\"<\/code><\/p>\n<p>If everything is fine, the Terminal will return \u201cOK\u201d<br \/> If you get a warning there, then obviously something in wrong in the database. In theory, Outlook should detect issues and automatically attempt to fix them, but there are been reports in the forums of identity failures and users no longer able to open up their identities. It might be worth attempting other &#8220;rescue&#8221; operations in these cases using additional commands like &#8220;.dump\u201d etc. (which is beyond the point of this post: search for your favorite sqlite How To or Forum page for additional information on <a href=\"https:\/\/www.google.com\/#safe=off&amp;q=how+to+repair+a+corrupted+sqlite3+database\">how to repair a corrupted sqlite3 database<\/a>).<\/p>\n<p>\u2022\u00a0A number of websites have illustrated how &#8220;vacuuming&#8221; the envelope index could help speed things up and trim the database in Mail. I figured that the same should apply to Outlook too.<br \/> I ran the command in Outlook and the database shrunk a bit. No problem within Outlook whatsoever on my Mac, but who knows\u2026 (hence the very very strong suggestion to make a backup).<br \/> \u201c<a href=\"https:\/\/www.sqlite.org\/lang_vacuum.html\">Vacuuming<\/a>\u201d\u00a0will rebuild the database file, reclaiming free space and defragmenting tables and index. I&#8217;m not sure whether Outlook is currently using auto_vacuum or not, but I have read reports of abnormally large Outlook database files which makes me suspect it&#8217;s not always taking place as it should if it is even enabled.<\/p>\n<p>You can vacuum the database using:<br \/> (triple-click the command to select all, then copy)<br \/> <code>\/usr\/bin\/sqlite3 ~\/Library\/Group\\ Containers\/UBF8T346G9.Office\/Outlook\/Outlook\\ 15\\ Profiles\/Main\\ Profile\/Data\/Outlook.sqlite vacuum<\/code><\/p>\n<p><\/p>\n<p>On <a href=\u201chttps:\/\/answers.microsoft.com\/en-us\/msoffice\/forum\/msoffice_outlook-mso_mac\/outlook-2016-for-mac-outlook-couldnt-repair-the\/e486e7b1-6c6e-46e8-9387-36f2442508b9\u201d target=\u201c_blank\">Answers<\/a>, Michal Palat provides additional options that can allow you to rebuild the sqlite3 database by exporting the data to an ASCII \u201cdump\u201d and recreating a new one based on the output:<br \/>\n<a href=\u201chttps:\/\/answers.microsoft.com\/en-us\/msoffice\/forum\/msoffice_outlook-mso_mac\/outlook-2016-for-mac-outlook-couldnt-repair-the\/e486e7b1-6c6e-46e8-9387-36f2442508b9\u201d target=\u201c_blank\u201d>https:\/\/answers.microsoft.com\/en-us\/msoffice\/forum\/msoffice_outlook-mso_mac\/outlook-2016-for-mac-outlook-couldnt-repair-the\/e486e7b1-6c6e-46e8-9387-36f2442508b9<\/a><\/p>","protected":false},"excerpt":{"rendered":"<p>Outlook 2011 had a proprietary database format and we (as users) had very few options to work with it. Outlook 2016 now uses a sqlite3 databases for its identity (just like Mail). While there is very little we can run from the app itself in terms of maintenance or troubleshooting, in theory we should be able to tap straight into the database through sqlite3 itself. *********\u00a0NONE OF THIS IS PUBLISHED\/APPROVED\/SUPPORTED BY MICROSOFT FOR OUTLOOK FOR MAC\u00a0********* As none of this is officially supported, I would&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[29],"tags":[],"class_list":["post-295","post","type-post","status-publish","format-standard","hentry","category-outlook"],"_links":{"self":[{"href":"https:\/\/www.cortig.net\/wordpress\/wp-json\/wp\/v2\/posts\/295","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cortig.net\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cortig.net\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cortig.net\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cortig.net\/wordpress\/wp-json\/wp\/v2\/comments?post=295"}],"version-history":[{"count":8,"href":"https:\/\/www.cortig.net\/wordpress\/wp-json\/wp\/v2\/posts\/295\/revisions"}],"predecessor-version":[{"id":321,"href":"https:\/\/www.cortig.net\/wordpress\/wp-json\/wp\/v2\/posts\/295\/revisions\/321"}],"wp:attachment":[{"href":"https:\/\/www.cortig.net\/wordpress\/wp-json\/wp\/v2\/media?parent=295"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cortig.net\/wordpress\/wp-json\/wp\/v2\/categories?post=295"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cortig.net\/wordpress\/wp-json\/wp\/v2\/tags?post=295"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}