Today I created a new test company in my development environment and then restored the TWO database into my new TEST database. I dutifully ran the GP refresh company script and got a few strange errors, but eventually ran the script successfully.
But when I logged into GP and selected my new Test company, I received this error:
The selected company is not configured as a company of the current Microsoft Dynamics GP system database. You must resolve the database configuration to log in to the company.
I've never seen this error before, so I didn't know where to start. I Googled the message, and after digging around, I finally found a GP partner post that discussed the issue and mentioned that the problem was with the SY00100 table in the new company database. The record in that table should reference the Dynamics GP System database, not the Company database.
Sure enough, the SY00100 table in my new Test company had its own INTERID value of TEST, instead of the DYNAMICS system database. I corrected the value in SY00100 and was able to login.
Turns out that Tim Wappat documented this issue in detail a year ago, but I didn't see it in the Google search results.
Here is Tim's post from January 2015:
And I now see that Jen Kuntz also documented the issue in August 2015: