
Moving Full-Text Catalogs
To move a full-text catalog, use the following steps. Note that when you specify the new catalog location, only new_path is specified instead of new_path/os_file_name.
-
Run the following statement.
ALTER DATABASE database_name SET OFFLINE
-
Move the full-text catalog to the new location.
-
Run the following statement where
logical_name is the value in the name column in sys.database_files and new_path is the new location of the catalog.
ALTER DATABASE database_name MODIFY FILE ( NAME = logical_name , FILENAME = 'new_path')
-
Run the following statement.
ALTER DATABASE database_name SET ONLINE
Alternatively, you can use the FOR ATTACH clause of the CREATE DATABASE statement to move a full-text catalog. The following example creates a full-text catalog in the AdventureWorks database. To move the full-text catalog to a new location, the AdventureWorks database is detached and the full-text catalog is physically moved to the new location. Then the database is attached specifying the new location of the full-text catalog.
USE AdventureWorks;
CREATE FULLTEXT CATALOG AdvWksFtCat AS DEFAULT;
GO
USE master;
GO
--Detach the AdventureWorks database.
sp_detach_db AdventureWorks;
GO
--Physically move the full-text catalog to the new location.
--Attach the AdventureWorks database and specify the new location of the full-text catalog.
CREATE DATABASE AdventureWorks ON
(FILENAME = 'c:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\Data\AdventureWorks_Data.mdf'),
(FILENAME = 'c:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\Data\AdventureWorks_log.ldf'),
(FILENAME = 'c:\myFTCatalogs\AdvWksFtCat')
FOR ATTACH;
GO