I just made a backup of a live NAV 2013 R2 database to do an upgrade to NAV 2015. Since the system is live we have several servers running when the backup is created.
The backup was restored in a new environment and the database opened with a NAV 2015 Developement Client. The database is put in single user mode and converted. After the conversion a process to upgrade objects starts. Here is where things start to behave in an unwanted way.
The database is in a Single User Mode since it is still in the upgrade transaction and no NAV Server instance is connected. However, in the table “Server Instance” all the old NAV Server instances are listed. To get through this I needed to press N like a thousand times…
In a test upgrade process like this we need to add another step to the usual upgrade procedure. After the restore is completed make sure that the tables “Server Instance” and “Active Session” are empty.
After a restore to a new environment it is also good to clean unneeded users from the database. Only leave what is actually needed.
In this case the NAVLIGHT\srvNAV is the service user. Also make sure that the Compatibility Level is as new as possible and the Recovery Model in line with the backup process.
Also, when moving from one environment to another the users connected to the old domain are obsolete. Going to Users and trying to remove them results in an error and the user is only disabled.
In some cases this could be enough. It is possible to completely remove the user, just do some housekeeping first. Find the user in “User Personalization” and Edit the record. On the Action ribbon we can clean some of the user trails.
Finally make sure that the record is deleted from “User Personalization”.
After this cleanup work the user can be safely deleted.
Thanks for the post.I have experienced the same problems a couple of times. But if you are going to restore the DB in your own environment/another domain just for testing purposes you don’t need the users. If there aren’t any NAV users you can connect to the db without defining a NAV user and you get the role/permission set super, just like cronus installation. However this doesn’t work if your NST is set to NavUserPassword. Then you need to define the user and set permission set which you can do with powershell.
Script to 2013:
USE ;
TRUNCATE TABLE “User Personalization”;
TRUNCATE TABLE “User Property”;
TRUNCATE TABLE “Access Control”;
TRUNCATE TABLE “User”;
GO
— Afterwards you have give the NST user acces to the DB and then restart the NST
Reference:
http://msdn.microsoft.com/en-us/library/jj551765(v=nav.70).aspx
Earlier versions than 2013:
USE ;
TRUNCATE TABLE “User”;
TRUNCATE TABLE “Windows Login”
GO