Problem in accessing NAV after moving SQL data files

Dear All,

I have a issue in accessing NAV companies. I have a client who has 2 databases in SQL server, whose database files are located in C:\Program files. They were unable to access NAV. When I checked there was not enough space in C drive. So, I decided to move the SQL data files of one database to another drive to free up the space. I have moved mdf, ldf and ndf files to other drive.

When I look into the database list in the server from Navision, I was able to see the database whose files I have moved out. I did a search and find that, i need to change the files location of the database. I did using the altr command from SQL server, which is like below

ALTER database [Draeger TestDbase]

MODIFY FILE ( NAME =‘Draeger TestDbase_Data’, FILENAME = ‘E:\SQLData\TestDB\Draeger TestDbase_Data.mdf’)

ALTER database [Draeger TestDbase]

MODIFY FILE ( NAME =‘Draeger TestDbase_Log’, FILENAME = ‘E:\SQLData\TestDB\Draeger TestDbase_Data.ldf’)

ALTER database [Draeger TestDbase]

MODIFY FILE ( NAME =‘Draeger TestDbase_1_Data’, FILENAME = ‘E:\SQLData\TestDB\Draeger TestDbase_1_Data.ndf’);

But still I was not able to see the database from NAV or I was able to see the tables from SQL Server.

Later I created a new database by attaching the SQL datafiles, moved to new drive, using the below command

CREATE DATABASE [database_name] ON 
( FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Data\<database name>.mdf' ),
( FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Data\<database name>.ldf' )
 FOR ATTACH ;
GO.

Now I could able to open the newly created database from above command, but I couldn' see any companies,
 but all the objects are imported properly.

Please suggest me, If I am missing any other necessary steps.

Thanks in advance...

Regards,
Venu

Hi Venu,

It is always better to take the backup of existing database and restore it on the other drive.

My adivice is that Take backup of the SQL database and restoe it wherever you want . Sychronize the users and then start working.

This will solve ur problems.

Thanks amol for uor advice.