HOWTO:Sync And Purge
Command Line Shortcut: NONE User Permissions Level: All |
Warning: Backup your database before doing this. I'm not kidding. |
Contents
Concept
The WireCAD synchronizer prioritizes deleted records by placing the key for the deleted record in a special table called [TABLENAME]_tombstones. Once a key exists in the [TABLENAME]_tombstones table any record that attempting to sync that has a matching key will be deleted. Using this knowledge we can purge a database of undesirable records (maybe you are wanting to remove all data from the stock WireCAD database and use only records that are important to you) thus ensuring that those records will always be deleted when syncing two WireCAD global databases even though one may contain stock data.
Before You Start
Backup your database before doing this. Your global database may be on your local machine or on a network share or a SQL server. We can't tell from here. You will need to figure this out so you can properly back up.
See these topics on file location:
Settings:Application_Global_Database_Location
Knowledge_Base#Q:_Where_Does_WireCAD_Put_Files.3F:Where Does WireCAD Put Files
Proceedure
- Back up your database. Did I say that?
- Open your global Manufacturers database. Database>Manufacturers Grid.
- We will be using the [User Added] field to store a flag ([User Added] is the only user field in this table) that we can filter on later. If the [User Added] field does not show in the grid, right-click any column header and click Column Chooser, then drag the [User Added] field onto the column header row.
- Populate the [User Added] field with some known data that we can filter on later. For purposes of this tutorial we will use "1" as the flag but you can substitute anything you like.
- Enter 1 in the top row.
- Drag from the top row to the bottom row. Be careful to only select the [User Added] column.
- Click Edit>Copy Down. This will copy 1(this top row) into all the cells in the [User Added] column.
- Click File>Save.