I have the same issue....ESRI has been working on a fix for over a day. I may try what you did. Were there any unexpected consequences? Amazingly the reason for the error is deleted living atlas content. Who knew
I had thought about deleting the livingatlasdif.sql file like mentioned above but this is my production environment so I was hesitant. I have a premium support ticket in and they have been working on the fix for 4 days. This apparently is an known issue since 10.6. If you have any living atlas content deleted from your portal this will happen. This script is trying to update all the living atlas items and if they don't exist it fails. The strange part is the living atlas items are not even delete protected. Seems like a huge oversight on ESRI's part.
Totally agree, not delete protected and basically forced all over your organization content. I talked to ESRI this morning and they suggested I look at the admin page here: your_portal_url/portalname/portaladmin/system/indexer and then run index status. He said if there is stuff in there mismatched to reindex it and it should work. This process basically updates that sql file for the livning atlas stuff and it should skip over those ones that got deleted, I am trying to recreate this dilemma in my dev environment. Have you come across this information yet, This after my 4th call to tech support on our maintenance agreement
This is not the case. My index was fine.
The livingatlas script is part of the create site function in the installer. If any living atlas item that was originally installed is missing this script will fail. This must be a difficult fix because I have premium support and esri developers working on this and they have been for a while. I am not sure what to tell you other than let your support analyst know that this is a current ticket with premium support and you have the same issue.
I was able to install 10.6.1 on my dev environment, blow away all of the living atlas layers and then try to upgrade to 10.7.1 and got the exact same issues again. I am confident like you this is the issue. I did the 10.7.1 upgrade, and then tried to do the post install upgrade which obviously failed. Using Sharfraj Nawaj Tosrif Zaman strategy of removing C:\Program Files\ArcGIS\Portal\framework\template\sql\10.7.0_to_10.7.1\livingatlasdiff.sql and then performing the post install upgrade a second time around, I had regular success. I have not seen any issues or anything since other than the index being out of whack which I am reindexing right now. I think Im going to use this method when I upgrade my production environment this Friday. I really dont see any other way around it without having to do a fresh clean install