Hello, thank you for respond!
The problem has been already found: after copying tables from server A to server B (I used the Export and Import data wizard), the "id" column in each table became "Is Identity = NO".
For testing, I dropped and recreated the mdl_sessions table, and then could browse the site, and log in as admin, and browse site pages..
But, other tables are with "id isidentity=NO" too, and either they all should be recreated at once with some script - but all their records will be lost..
Or should I have used another way to copy tables from A to B?
I tried to use backup at A, and restore at B, but the SQL on B gave me an error that SQL versions are different...
Btw, I tried the Export&Import Data Wizard on SQL on A again, and checked "Insert identity". But again after copying finished, on server B all "id" columns were "IsIdentity=NO".