Business needs sometimes dictate that a specific replicated archive is no longer needed. It may be that you are changing the replicated location from one to another, that you are transferring the server between machines (physical or virtual) at the same location, or that you just no longer need replication. Whatever the reason, the process will be to remove the replicated archive server before decommissioning it. This will help prevent and limit errors and orphaned files. This article explains how to remove a replicated SOLIDWORKS PDM Archive Server. Let’s get started.
Removing the Replicated Archive
First and foremost, it’s important to remember that backups are important! Before anything else, ensure you have recent backups of both your archive and database servers. In the event that anything goes wrong, you’ll be glad you have those to revert to.
-
- In the Administration tool, right-click on the vault you plan to Remove and select Remove.
- In the Administration tool, right-click on the vault you plan to Remove and select Remove.
-
- In the dialogue box that appears, verify that you wish to remove the specific vault from the selected server and enter the SQL “sa” credentials.
- In the dialogue box that appears, verify that you wish to remove the specific vault from the selected server and enter the SQL “sa” credentials.
-
- Hit Yes in the following dialogue box, and the process will begin.
- Hit Yes in the following dialogue box, and the process will begin.
-
- Once the process is complete, the admin tool should show that the Replicated vault is no longer present.
-
- Note: If it still shows the server that was just removed, right-click the Host Server’s name and select Refresh from the menu that appears.
- Note: If it still shows the server that was just removed, right-click the Host Server’s name and select Refresh from the menu that appears.
-
- Once the process is complete, the admin tool should show that the Replicated vault is no longer present.
Manual Removal
In the event that the process described above does not work or access to the Replicated server/servers being removed has been lost, there is an alternate, manual method.
Important: This manual removal method should only be used when necessary, as the potential for error is greater.
The process for Manual Removal will differ based on the ending state of the vaults concerned. If you are removing replications to the extent that you will no longer have a replicated archive (going from 1 “main” archive and 1 or more replicated to ONLY 1 “main” archive) that will be the first Scenario: Scenario A. If you are removing replications such that you will still have 1 main archive and 1 replicated archive, that will be Scenario B.
- Scenario A: Manually removing ALL replication.
- Scenario B: Manually removing one or more replications (NOT ALL).
Regardless of the scenario, the steps will start as follows:
Part 1: File Discovery
- Start the SQL Management Studio and log into the SQL server as an admin (“sa” or otherwise).
- Load the ShowUniqueARchiveServerFiles_v3.sql query.
- Run the query against the database (DB) to get the list of file versions unique to the server being removed.
- If any files are returned by the query, you will want to replicate them (if possible) prior to manual removal.
Part 2: Manual Removal
- Open the table called Archive Servers.
- Expand the Data Base and right-click dbo.ArchiveServers
- Select Edit Top 200 Rows.
- The table will contain a Row for each archive server that is replicating the vault.
- Select the Row for the server or servers that are being removed.
- Right-click the Row, select Delete, and confirm the deletion.
- Repeat as needed.
- For Scenario A: Repeat until only the Main server entry exists.
- For Scenario B: Repeat until the replications you intend to remove are gone.
- Verify that the correct server or servers remain in this list.
From here, the Scenarios will begin to differ. The next set of instructions is split up by Scenario.
Scenario A (continued)
-
- Right-click the vault database.
-
- Select New Query.
- Select New Query.
-
- Enter the following: TRUNCATE TABLE ArchiveServerStored
-
- Verify the vault Database is the one selected and execute.
- Verify the vault Database is the one selected and execute.
-
- If the database has a table named ArchiveServerRemoved, also run TRUNCATE TABLE ArchiveServerRemoved
-
- Now open the registry and navigate to the following key: HKEY_LOCAL MACHINE\Software\SolidWorks\Applications\PDMWorks Enterprise\Archive Server\Vaults\[VAULTNAME]*
-
- Note: This should be the actual name of your vault. In other words, if the vault is named PDM_vault_3, that key will be HKEY_LOCAL MACHINE\Software\SolidWorks\Applications\PDMWorks Enterprise\Archive Server\Vaults\PDM_vault_3
-
- Now open the registry and navigate to the following key: HKEY_LOCAL MACHINE\Software\SolidWorks\Applications\PDMWorks Enterprise\Archive Server\Vaults\[VAULTNAME]*
-
- Delete the Replicate value.
- Delete the Replicate value.
-
- Open the vault archive and locate the folder “0” (you can find the folder path on the server under registry key: HKEY_LOCAL_MACHINE\SOFTWARE\Solidworks\Applications\PDMWorks Enterprise\ArchiveServer\Vaults\[VAULTNAME]\ArchiveTable)
- Open the vault archive and locate the folder “0” (you can find the folder path on the server under registry key: HKEY_LOCAL_MACHINE\SOFTWARE\Solidworks\Applications\PDMWorks Enterprise\ArchiveServer\Vaults\[VAULTNAME]\ArchiveTable)
-
- Delete Users.dat.00xx.bin (the “xx” will be two digits such as 09, or 02, etc.)
- Delete Users.dat.00xx.bin (the “xx” will be two digits such as 09, or 02, etc.)
-
- Open Services and locate the Archive Server Service.
-
- Right-click and restart the service.
Scenario B
-
- Open the Registry Editor on the server being removed.
-
- Locate: HKEY_LOCAL_MACHINE\Software\SolidWorks\Applications\PDMWorks Enterprise\ArchiveServer\Vaults\[VAULTNAME]
- Locate: HKEY_LOCAL_MACHINE\Software\SolidWorks\Applications\PDMWorks Enterprise\ArchiveServer\Vaults\[VAULTNAME]
-
- Delete that Registry folder.
-
- Navigate to HKEY_LOCAL_MACHINE\Software\SolidWorks\Applications\PDMWorks Enterprise\ArchiveServer\Computers\<local>\Archives
- Navigate to HKEY_LOCAL_MACHINE\Software\SolidWorks\Applications\PDMWorks Enterprise\ArchiveServer\Computers\<local>\Archives
-
- Remove the vault name from the Vaults entry.
-
- Navigate to the Archive Folder on the replicated vault and delete it.
- Navigate to the Archive Folder on the replicated vault and delete it.
-
- Restart the Archive server service (in Services).
Manually Replicating Files
You may receive a vault error stating, “The vault contains files that are not yet available on any other archive server and can therefore not be deleted.” In this case, it is necessary to “force” or “manually” replicate files before proceeding with the removal. This is done to prevent data loss and is fairly straightforward.
Check the Replication Status of the Vault
-
- From the PDM Administration tool, log into the vault as the built-in ADMIN user.
-
- Select Replication from the left-hand menu.
-
- Then select Archive and right-click Archive Status.
-
- Select Open.
- Select Open.
-
- You should be presented with a status report that looks a bit like this:
- You should be presented with a status report that looks a bit like this:
-
- If that archive has been replicated to other machines, you will see several entries in the Archive Server dropdown and can compare the values for un-replicated files and the percentage of files fully replicated to the server you choose to look at.
-
- Looking at this page will not tell you the exact files needed to replicate, but you can return to this page to verify that everything has been replicated.
On-Demand Replication and Locating Un-replicated Files
-
- At this point, there are a few choices (pick whichever is best for you).
-
- Run a “get latest” on the entire vault from whichever archive server is still missing files according to the Archive status page under replication.
-
- Procedure below:
-
- From the root of the vault, select all files and folders visible (CTRL + A)
-
- Right-click.
-
- Get latest Version.
-
- Procedure below:
-
- This will often solve the problem but can take a while to complete, especially in larger vaults.
-
- Run a “get latest” on the entire vault from whichever archive server is still missing files according to the Archive status page under replication.
-
- Run more targeted “get latest” commands on individual files or even file folders.
-
- If targeting files and folders with fewer subfolders or documents, this should take less time but can occasionally leave files behind. Fortunately, those will show up as still needing to be replicated.
-
- When right-clicking on Archive Status, select Show Missing Files.
- When right-clicking on Archive Status, select Show Missing Files.
-
- Doing so should generate a .csv file that can be opened as a spreadsheet and used to help locate any missing files. (The File Name column will contain the file path starting from the root folder “\”
-
- Now, locate the folders and files you wish to “manually” replicate (also known as “on-demand” replication) and right-click.
-
- Get latest.
-
- Once complete, check the Archive Status page again. Select refresh and verify all the files are replicated.
-
- If targeting files and folders with fewer subfolders or documents, this should take less time but can occasionally leave files behind. Fortunately, those will show up as still needing to be replicated.
-
- Run more targeted “get latest” commands on individual files or even file folders.
-
- At this point, there are a few choices (pick whichever is best for you).
Orphaned Vault Views
It is possible that some vault views were still “pointing” at the replicated Archive removed in the steps above. These “Orphaned” vaults have lost a connection to the vault (in this case through their archive) and no longer grant access as intended.
The simplest way to correct this is to delete the File Vault view and recreate it with the View Setup tool. However, if the user had any files checked out when the Replicated archive was removed, there is a risk of losing work on the files that were checked out. If this happens, follow these instructions to Replace an Orphaned Vault View.
Additional Notes
While the instructions above provide a firm basis for how to complete this step, it may be just another step in a larger process (as mentioned earlier) such as moving the replicated server. To help smooth the transition in such a scenario, we have included some additional points of interest below and general best practice reminders.
As discussed in our blog SOLIDWORKS PDM: Setting Up Replication, there are a few different ways to set up replication (Ring, Tree, Hub/Spoke), and they may affect how and when you wish to retire a replicated archive. We suggest familiarizing yourself with the replication configuration in place before deciding when to remove the replicated archive. Even if the change is meant to simply update the machine (virtual or otherwise) the replication is hosted on, you will need to make plans for when to create the new replication and how to fit it into the current configuration, as well as when to remove the old replication.