Answer
This procedure outlines how to rename an Archive Store including all of its components (like database, MDF and LDF files, binary and index folders). In this example the Archive Store [2013 Jan - Dec OLD] is renamed to [2013 Jan - Dec NEW].- Open the GFI Archiver web page
- Navigate to Configuration > Archive Stores
- Select the Archive Store that you want to rename
- Click on the Summary button
-
Take a screenshot to keep a record of the database and paths
- For this guide, let's assume:
- Archive Store Name: [2013 Jan - Dec OLD]
- Database Name: [2013 Jan - Dec OLD]
- Server: [SQLSERVER\SQLINSTANCE]
- Path to the binary source: [C:\Program Files\GFI\Archiver\Databases\2013 Jan - Dec OLD\Binary]
- Path to search index: [C:\Program Files\GFI\Archiver\Indexes\2013 Jan - Dec OLD]
- Close the Summary dialog
- Use the detach button to detach Archive Store from GFI Archiver
- Open the Microsoft SQL Management Studio
- Connect to the Micosoft SQL instance on which the database resides [SQLSERVER\SQLINSTANCE]
- Expand the Databases node in the tree in the Object Explorer
- Right click on the database that you want to rename and click on Properties
- Open the Files page
-
Take a record (screenshot) of the paths and file names of the MDF and LDF files
- For this guide, let's assume:
- [C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\2013 Jan - Dec OLD.mdf]
- [C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\2013 Jan - Dec OLD_log.ldf]
- Close the Database Properties dialog by clicking on cancel
- Right click on the database that you want to rename and click on Tasks > Detach...
- Tick the option "Drop connections"
- Click on the OK button to detach the database from the Microsoft SQL Server
- Open the folder in which the MDF file is located [C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\]
- Rename the MDF file to: [2013 Jan - Dec NEW.mdf]
- Open the folder in which the LDF file is located [C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\]
- Rename the LDF file to: [2013 Jan - Dec NEW_log.ldf]
- In the Microsoft SQL Management Studio, right click on the Databases node in the Object Explorer and choose the option "Attach..."
- Within the "Databases to attach" section, click on the Add button
- Choose the file [2013 Jan - Dec NEW.mdf]
- Within the "Databases to attach" section, change the value of the "Attach As" column to match the new database name [2013 Jan - Dec NEW]
- Within the "Original File Name" section, change the values of the "Current File Path" column to the renamed MDF and LDF files
- [C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\2013 Jan - Dec NEW.mdf]
- [C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\2013 Jan - Dec NEW_log.ldf]
- Click on the OK button to attach the database
- Right click on the database that you want to rename and click on Properties
- Open the Files page
-
Change the values of the "Logical Name" column to the new database name
- [2013 Jan - Dec NEW]
- [2013 Jan - Dec NEW_log]
- Close the dialog by clicking on the OK button
-
Open Windows Explorer and rename the binary and index folder to the desired new names (reference the screenshot in step 5)
- [C:\Program Files\GFI\Archiver\Databases\2013 Jan - Dec NEW\Binary]
- [C:\Program Files\GFI\Archiver\Indexes\2013 Jan - Dec NEW]
- Open the GFI Archiver web page
- Navigate to Configuration > Archive Stores
- Click on the Attach button
- Go through the wizard and attach the Archive Store again choosing / specifying the new database name and folders for the binary / index locations
Notes
- Not all Archive Stores have a binary folder
- This procedure is based on Microsoft SQL Server 2012 and that the dialogues and options might differ in other versions of Microsoft SQL Server, however the same principles should apply though