How to recreate the SQL LocalDB instance
Use these steps to recreate the Cayosoft Guardian SQL LocalDB instance when requested by Support.
Stop the Cayosoft Guardian service.
-
Wait 10–15 minutes. After the service is stopped, SQL LocalDB should detect that nothing is using it and shut down after some time.
Optionally, check Task Manager for
sqlservr.exerunning under the System account.Do not stop all
sqlservr.exeprocesses. Other products on the server may also use SQL, such as Cayosoft Administrator.
Open Command Prompt as an administrator.
-
Run:
Copycd /d "C:\Windows\System32\config\systemprofile\AppData\Local\Microsoft\Microsoft SQL Server Local DB\Instances" -
Run:
Copyren CayoInstance CayoInstance2NOTE: This command renames the
CayoInstancefolder, effectively removing it from Guardian’s view so that the instance can be recreated. If the
rencommand fails,sqlservr.exeis likely still running and holding the folder. Wait and retry the command until the rename succeeds.Start the Cayosoft Guardian service.
If the instance is not recreated automatically
If the LocalDB instance contained only Archive databases, Cayosoft Guardian may not recreate the instance automatically. In this case, create the instance manually by running the following command from a Command Prompt running as Local System:
sqllocaldb create CayoInstance
NOTE: You can use PsTools (PsExec) to run Command Prompt as Local System.
Re-register Archive databases
Archive databases are not automatically registered on the newly created instance. To register them again:
-
Locate the database files. The default folder is:
CopyC:\ProgramData\Cayo Software\Guardian\database In Cayosoft Guardian, navigate to Settings > Archive Databases.
Select the Archive database and click Remove. If it was the default Archive database, select the Deregister checkbox.
Click + New.
-
Specify the following SQL server name:
Copy(LocalDb)\CayoInstance -
Enter the database name. For example:
CopyCayoArchive -
In the additional connection parameters, enter:
CopyAttachDbFileName=[path to the database file]For example:
CopyAttachDbFileName=C:\ProgramData\Cayo Software\Guardian\database\CayoArchive.mdf Keep the Create if not present checkbox selected.
Comments
0 comments
Please sign in to leave a comment.