Remove a Replicated SOLIDWORKS PDM Archive Server

Article by Joe McWhorter on Sep 08, 2023

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.

  1. In the Administration tool, right-click on the vault you plan to Remove and select Remove

    Removing a Replicated SOLIDWORKS PDM Archive Server

  2. 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. 

    SA Credentials SOLIDWORKS PDM Administration Dialog

  3. Hit Yes in the following dialogue box, and the process will begin. 

    Remove File Fault Database SOLIDWORKS PDM

  4. Once the process is complete, the admin tool should show that the Replicated vault is no longer present. 
    1. 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. 

      SOLIDWORKS PDM Administration Repliclone

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

  1. Start the SQL Management Studio and log into the SQL server as an admin ("sa" or otherwise). 
  2. Load the ShowUniqueARchiveServerFiles_v3.sql query. 
  3. Run the query against the database (DB) to get the list of file versions unique to the server being removed. 
  4. If any files are returned by the query, you will want to replicate them (if possible) prior to manual removal. 

Part 2: Manual Removal

  1. Open the table called Archive Servers.
  2. Expand the Data Base and right-click dbo.ArchiveServers 
  3. Select Edit Top 200 Rows

    Manually Remove Archive Server in SOLIDWORKS PDM

  4. The table will contain a Row for each archive server that is replicating the vault. 
  5. Select the Row for the server or servers that are being removed.
  6. Right-click the Row, select Delete, and confirm the deletion. 
  7. Repeat as needed.  
    1. For Scenario A: Repeat until only the Main server entry exists. 
    2. For Scenario B: Repeat until the replications you intend to remove are gone.
  8. 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.

    New Query SOLIDWORKS PDM Vault Database

  • Enter the following: TRUNCATE TABLE ArchiveServerStored
  • Verify the vault Database is the one selected and execute.

    Truncate Table Archive Server SOLIDWORKS PDM

  • 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 
  • Delete the Replicate value. 

    Delete Replicate Value SOLIDWORKS PDM

  • 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 Archive Table SOLIDWORKS PDM

  • Delete Users.dat.00xx.bin (the “xx” will be two digits such as 09, or 02, etc.) 

    Remove Replicated SOLIDWORKS PDM Archive Server Instructions

  • Open Services and locate the Archive Server Service.
  • Right-click and restart the service.


    Restart Archive Service SOLIDWORKS PDM

Scenario B

  • Open the Registry Editor on the server being removed.  
  • Locate: HKEY_LOCAL_MACHINE\Software\SolidWorks\Applications\PDMWorks Enterprise\ArchiveServer\Vaults\[VAULTNAME] 

    SOLIDWORKS PDM Delete Registry Folder

  • Delete that Registry folder. 
  • Navigate to HKEY_LOCAL_MACHINE\Software\SolidWorks\Applications\PDMWorks Enterprise\ArchiveServer\Computers\<local>\Archives

    Project Server SOLIDWORKS PDM Vault Archive Server

  • Remove the vault name from the Vaults entry. 
  • Navigate to the Archive Folder on the replicated vault and delete it.

    SOLIDWORKS PDM Replicate Delete Archive Folder

  • Restart the Archive server service (in Services).

Manually Replicating Files

SOLIDWORKS PDM Administration The Vault Contains Files Not Yet Available Message

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

  1. From the PDM Administration tool, log into the vault as the built-in ADMIN user. 
  2. Select Replication from the left-hand menu. 
  3. Then select Archive and right-click Archive Status.  
  4. Select Open.

    SOLIDWORKS PDM Check Replication Status of Vault

  5. You should be presented with a status report that looks a bit like this: 

    Archive Status Screen in SOLIDWORKS PDM

  6. 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.  
  7. 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

  1. At this point, there are a few choices (pick whichever is best for you).
    1. Run a “get latest” on the entire vault from whichever archive server is still missing files according to the Archive status page under replication. 
      1. Procedure below: 
        1. From the root of the vault, select all files and folders visible (CTRL + A)
        2. Right-click.
        3. Get latest Version.  
      2. This will often solve the problem but can take a while to complete, especially in larger vaults. 
    2. Run more targeted “get latest” commands on individual files or even file folders.
      1. 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.  
        1. When right-clicking on Archive Status, select Show Missing Files.

          SOLIDWORKS PDM Show Missing Files Option

        2. 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 “\” 
        3. Now, locate the folders and files you wish to “manually” replicate (also known as “on-demand” replication) and right-click.
        4. Get latest
        5. Once complete, check the Archive Status page again. Select refresh and verify all the files are replicated.  

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.

I hope you found this article helpful. Learn more about SOLIDWORKS PDM by checking out the articles listed below.

More SOLIDWORKS PDM Tutorials

How to Move Your SOLIDWORKS PDM Server Components

SOLIDWORKS PDM Variable Mapping Tips & Tricks: Mass Properties, File Properties, Model Dimensions, & More

How To Set Up Barcodes in SOLIDWORKS PDM Data Cards

SOLIDWORKS PDM Preview Tab Mismatch

How to Install SOLIDWORKS with the PDM Client

VIEW ALL SOLIDWORKS PDM TUTORIALS

 

About Joe McWhorter

Joe McWhorter is a SOLIDWORKS Technical Support Engineer at GoEngineer.

View all posts by Joe McWhorter