HomeDatabase AdministrationPrinter Friendly Version

Database Administration

Administrating the PureCM server database. These artcile will include how to backup the files, make snapshots, run repository checks, import and export the data.

1. Setup

1.1. What are the recommended server configuration/system requirements for running the PureCM Server?

  • 133 MHz or higher Pentium-compatible CPU.
  • 10MB of RAM per user plus the recommended memory for OS.
  • Free disk space for double the size of the source code. So it you intend on storing 1GB of source code, at most you will need 2GB free on the server.

1.2. Is there a limit on the number of files wich can be added to a PureCM repository?

No. There is no limit on the number of files which can be added to a PureCM repository.

2. The PureCM Database

2.1. What storage systems does PureCM use?

Up to PureCM 2010-1 

Up to PureCM 2010-1, PureCM used a purpose built database backend to store data. It is transaction based to maximise security and scales to multiple terabytes.

PureCM 2010-1 and onwards 

With the release of PureCM 2010-1, the default database has been changed to SQLite for new installations. SQLite is an embedded database that is installed automatically when selected, offering significantly better performance than the native database.

Additionally, support for existing SQL Server databases was added with PureCM 2010-1d to allow customers leveraging existing expertise and infrastructure. SQL Server databases are highly scalable and therefore recommended for large installations. Also, they can be managed using the powerful database management tools available, e.g. for backups or database replication.

2.2. Which database system should I use?

New users without an existing pre 2010-1 database can work with either SQLite or SQL server, depending on their needs.

  • SQLite is the cross-platform, low administration and zero cost solution that doesn't require any additional licenses or hardware. The PureCM server/database runs as a single service and thus offers great performance. Data volumes to hundreds of GB are supported.
  • SQL Server offers superior scalability and powerful database administration options, but is limited to servers running on Windows. Database licenses and expertise typically need to be present in-house to run on SQL Server.

To compare the performance between SQLite and SQL Server, as well as getting a comparison of running SQLite on different platforms, please click here.

 

Will the native database still be supported in the future?

Existing users with a database created with older releases than PureCM 2010-1 have automatically started to use PureCM's custom database. They can continue to use their native database, as PureCM continues supporting the native database until the release of its 2011-1 version in Q2 2011.

This timeframe should allow customers to plan for a mid-term migration to either SQLite or SQL Server. Migration requires a database export and import, which is explained following the links below.

 

2.3. Can I migrate from any database to another?

There are some enhancements to the new SQLite and SQL Server database support introduced with PureCM 2010-1 and 2010-1d respectively that restrict their backwards compatibility.

What you can do

  • Migrate a pre 2010-1 native database to SQLite or SQL Server
  • Migrate a SQLite database to SQL Server, or the other way around

What you cannot do

  • Migrate a pre 2010-1 native database to SQLite or SQL Server, and then back to the native database again

This case would typically occur when existing customers want to evaluate working with SQLite or SQL Server. However, they should do so with test data to assure that they can continue working with the status quo. Any evaluation download already includes an example database that can be used for that purpose.

Note that only one PureCM installation can be made on the same machine, i.e. you need to install your trial on a different machine than your production server.

 

2.4. Size of database files

When running the PureCM Windows Service, the database files stored (by default) in C:\PureCM\data are generally seen to be of zero size on first installation despite the fact that they obviously contain data.

This seems to be caused by Windows not updating the file sizes until the files are closed.  Stopping and Starting the PureCM Service should update this display.

2.5. Migrating from Native Database (pre-2010-1) to SQLite

Prerequisites 

We assume that you've made the decision to migrate your pre-2010-1 PureCM database to the newer SQLite format. In order to proceed, you will need to first install the new 2010-1 version of PureCM Server (choosing the SQLite database option on Windows). You will then need to shutdown PureCM Server before proceeding.

Obviously this process requires the PureCM Server to be down throughout the process.  There should be no visible difference to your users once completed (i.e. no need to recreate workspaces etc.).

Looking at the time needed, you would be looking at roughly 1h/GB for both import and export if done on the same server machine. Note that these times largely depend on hardware used and may vary.

tdbutil Database Utility 

We will be using the 'tdbutil' utility to perform the migration. This can be found in either of the following locations :-

C:\Program Files\PureCM\Server\tdbutil.exe (Windows)

/opt/purecm-server/bin/tdbutil (Linux/Unix)

Note that, in order to use tdbutil on Linux/Unix, you will also need to first execute :-

export LD_LIBRARY_PATH=/opt/purecm-server/lib

Temporary File Storage

It's also important to establish a folder/drive that can be used for temporary file storage. You will need to have space to store the size of the biggest current database plus another 25%. We will refer to this location as TMP and assume you will substitute with C:\Temp, D:\, /tmp or wherever is relevant for your server.

Establish the files to be migrated 

You then need to establish the datafiles that need to be migrated. These will typically be located in C:\PureCM\Data (Windows) or /opt/purecm-server/data (Linux/Unix). You need to find all the files ending with the .tdf extension (most will also have a matching file ending with .tbf that contains the revision data).

Migrate the Server Database

The first file to migrate is the 'server' database that contains username and overall server configuration details. You would typically perform migration of this database using :-

cd C:\Program Files\PureCM\Server\ (only on Windows)

cd /opt/purecm-server/data (only on Linux/Unix)

tdbutil export server TMP\server.xml

tdbutil import TMP\server.xml "type=sqlite;path=server;create=1"

Migrate each Repository 

You would then repeat the above for each other datafile present (normally just those beginning with 'r_' which are the repositories). We assume here that the only one present is the default 'Example' repository used typically during evaluation. You should substitute 'Example' in the instructions below with the name of your repository. 

tdbutil export r_Example TMP\r_Example.xml

tdbutil import TMP\r_Example.xml "type=sqlite;path=r_Example;create=1"   

Note that the .xml temporary files can be deleted, if necessary for space reasons, after each 'import' has completed. Once the import of all the Repositories is complete, you should also be able to move the old database files (*.tdf and *.tbf) out of the data folder and, when confident in the upgrade, remove them to free up space.

Database File Permissions 

Additionally, you will need to ensure that the newly created database files (those ending in '.db') have the correct permissions. On Linux, the files typically need to have 'purecm' as the owner, 'users' as the group and a chmod of '640' (or '-rw-r-----') - you should be able to identify the permissions of the existing files to see what's required in your environment.

On Windows, you should be able to inspect the file permissions either using the 'CACLS' command line tool or Windows Explorer via the 'Security' tab of the File Properties. Again, they will need similar permissions to the existing database files.

Check Availability after conversion

You should then be able to start the PureCM Server. You will need to monitor the Event Log (Windows) or syslog (Linux/Unix) to ensure that no errors are reported during startup.  You should probably try to connect to the server afterwards and check that all expected Repositories are visible and perform some confidence testing (create a workspace or browse Stream History etc.).

2.6. Migrating from Native Database (pre-2010-1d) to SQL Server

Prerequisites 

We assume that you've made the decision to migrate your pre-2010-1 PureCM database to a Microsoft SQL Server Database. In order to proceed, you will need to first install the new 2010-1d (or later) version of PureCM Server (choosing the SQL Server database option). You will then need to shutdown PureCM Server before proceeding.

Obviously this process requires the PureCM Server to be down throughout the process.  There should be no visible difference to your users once completed (i.e. no need to recreate workspaces etc.).

Looking at the time needed, you would be looking at roughly 1h/GB for both import and export if done on the same server machine. Note that these times largely depend on hardware used and may vary.

tdbutil Database Utility 

We will be using the 'tdbutil' utility to perform the migration. This can typically be found in :-

C:\Program Files\PureCM\Server\tdbutil.exe

Temporary File Storage

It's also important to establish a folder/drive that can be used for temporary file storage. You will need to have space to store the size of the biggest current database plus another 25%. We will refer to this location as TMP and assume you will substitute with C:\Temp, D:\, /tmp or wherever is relevant for your server.

Establish the files to be migrated 

You then need to establish the datafiles that need to be migrated. These will typically be located in C:\PureCM\Data (Windows) or /opt/purecm-server/data (Linux/Unix). You need to find all the files ending with the .tdf extension (most will also have a matching file ending with .tbf that contains the revision data).  There should only a files name server.* (main PureCM Server configuration settings) and r_*.tdf/tbf (the PureCM Repositories).

Migrate the Server Database

The first file to migrate is the 'server' database that contains username and overall server configuration details. You would typically perform migration of this database using :-

cd C:\Program Files\PureCM\Server\

tdbutil export server TMP\server.xml

tdbutil import TMP\server.xml "type=sqlserver;prefix=server_;create=1;server=localhost;username=sa;password=mypass;database=purecm;"

In the last command you should note that several items (server=,username=,password= and database=) will probably have different values in your environment.  Hopefully these are self-explanatory - they assume that your connecting to a SQL Server instance on the same machine, authenticating as the 'sa' (admin) user with a password of 'mypass' and that there is a pre-created 'purecm' database that will hold all the data.  You may also specify 'instance=' to specify a non-default instance of SQL Server.

Migrate each Repository 

You would then repeat the above for each other datafile present (normally just those beginning with 'r_' which are the repositories). We assume here that the only one present is the default 'Example' repository used typically during evaluation. You should substitute 'Example' in the instructions below with the name(s) of your repositories. 

tdbutil export r_Example TMP\r_Example.xml tdbutil import TMP\r_Example.xml "type=sqlserver;prefix=r_Example_;create=1;server=localhost;username=sa;password=mypass;database=purecm;"

Note that the .xml temporary files can be deleted, if necessary for space reasons, after each 'import' has completed. Once the import of all the Repositories is complete, you should also be able to move the old database files (*.tdf and *.tbf) out of the data folder and, when confident in the upgrade, remove them to free up space.

Check Availability after conversion

You should then be able to start the PureCM Server. You will need to monitor the Event Log (Windows) or syslog (Linux/Unix) to ensure that no errors are reported during startup.  You should probably try to connect to the server afterwards and check that all expected Repositories are visible and perform some confidence testing (create a workspace or browse Stream History etc.).

2.7. Scripted upgrade to SQL Server

Ensure Viability

Before attempting the migration to SQL Server we would advise some capacity/perfomance planning be done in consultation with your Database administrator.   Equally important is that you have an understanding of your backup/restore/disaster recovery options once your PureCM data is held in SQL Server.

Migrating to SQL Server should not affect your Developers/End Users in any way.  They will not need to recreate workspaces or otherwise change their client configuration.

Initial Tasks

Download the attached script to your machine.  It isn't intended to be used unmodified and there's some configuration work you'll need to do. The script itself is written in Microsoft PowerShell which obviously you'll need to have installed.  We recommend using PowerGUI and it's Script Editor which makes life easier but otherwise command line PowerShell is fine if you're comfortable wiith that.

There's a dependency of having PureCM Server 2010-1d (or later) installed on your server prior to performing the upgrade.  You should install the server with the SQL Server database option selected and ensure that it starts up correctly.  It will not initially have your existing repositories or configuration present.  You should ideally then shutdown the PureCM Service (the script tries to do this but could fail if you don't run it with Administrative privileges).

Configurable Items

If you open the script in PowerGUI Script Editor or Notepad, you'll see that the first few lines look similar to :-

# Configurable settings for your SQL Server...

$SQLServer = "localhost"

$SQLUser = "sa"

$SQLPassword = "reallysecret"

$SQLDatabase="test"

$SQLInstance=""

Obviously these settings are unlikely to work directly!  You'll need to change them to match your SQL Server environment.  The default is to use SQL Server authentication (i.e. user 'sa') but if you blank out the SQLUser and SQLPassword values it's possibly to use Integrated/Windows authentication if that's configured.

There are some other settings ($ProgDir which defaults to 'C:\Program Files\PureCM\Server' and $DataDir which defaults to 'C:\PureCM\Data') which you may need to customise ($ProgDir may need to be changed to 'C:\Program Files (x86)\PureCM\Server' on 64-bit Windows machines for instance).

The script defaults to creating temporary files in wherever the TEMP environment variable is set to (typically C:\users\myuser\appdata\local\temp or similar).  If there isn't enough space in this location, you may need to customise the setting of the $tempdir variable in the script.  You will need enough space to store the size of the largest repository database with an extra 25% allowance.

Running the Script

Once you've customised the script, you should be able to run it either by pressing F5 in the PowerGUI Script Editor or running 'powershell .\convert-purecmdb-to-sqlserver.ps1' from a command prompt.  If you run into problems with your machine preventing you from running an unsigned script you may need to do 'powershell Set-SecurityPolicy RemoteSigned' to avoid local scripts needing to be signed - PowerGUI can be more convenient in this case!

The script will output the basic configuration details and prompt you if it should continue.  You will need to type 'yes' in order for it to do so.  It should then run through the conversion process.  If you run into problems then you can forward the output to support@purecm.com and we'll try to help you out.

Post Conversion Checks

Once successfully complete, you should try to start the PureCM Service.  You should ideally check that there are no significant errors or warnings in the Windows Event log.

Obviously you'll probably also want to perform your own tests to ensure that the server is functional.  We would recommend that you at least make a connection from the PureCM Client to ensure that all expected Repositories are available.  Creating a workspace is a fairly good way to further check integrity.

3. Backing Up the Native Server Database

3.1. About Backup and restore

The PureCM database files are stored in the location specified when installing PureCM (typically PureCM\data). The following files will be found in the directory:

 

Table 15.1. PureCM Data Files

NameExtensionDescription
Data File tdf Contains all non-binary data
Binary Data File tbf Contains all binary data

 

If you want to backup the PureCM data files using a backup program such as NTBackup on Windows or 'tar' on Unix see the section called “How do I backup the PureCM server”. Although this is the simplest solution, it is recommended that you create database snapshots and back these up. Snapshots are compressed and therefore take up less space than the actual data files.

The PureCM snapshot files are stored in the location specified when installing PureCM (typically PureCM\snapshots). The following files will be found in the directory:

 

Table 15.2. PureCM Snapshot Files

NameExtensionDescription
Snapshot File tds A compressed copy of the data files which can be restored

 

See the section called “How do I create a Snapshot” for a description of how to create snapshots. See the section called “How do I restore a Snapshot” for a description of how to restore the snapshot.

If the PureCM database you are backing up is large then you typically wouldn't want to create more than one or two snapshots a day. While the snapshots are being created other users cannot use the tool, and the amount of storage required for many snapshots will soon mount up.

If you want to perform many backups during the day, a better solution is to backup the log file as described in the section called “Archiving the Log File”. To recover the database you would first recover the snapshot and then apply each log file as described in the section called “Applying the Log File”.

The PureCM log files are stored in the location specified when installing PureCM (typically PureCM\logs). The active log files will be found under the logs directory. Any archived log files will be found in the subdirectory 'archive' (e.g. PureCM\logs\archive).

 

Table 15.3. PureCM Log Files

NameExtensionDescription
Log Commands File tlf Contains the log of all commands
Log Pre-Image File tpf Contains the binary data used by the commands file

 

3.2. How do I backup the PureCM Server?

There are 2 recommended ways to backup the PureCM server:

  1. Create a snapshot
  2. Backup the database files manually

3.3. How do I create a snapshot?

You can create a snapshot using the 'pcm admin make-snapshots' command (type 'pcm help admin make-snapshots' for details).

Alternatively, if you have Python installed on the server machine you can call MakeDatabaseSnaphots() within the server script file. The 'Scripts' tree item will appear in the GUI if you have the 'Scripts Administration' policy enabled. If you wanted to make a snapshot everyday at 3:00am the script would contain:

def( OnEveryHour(hour):

    if hour == 3:

        MakeDatabaseSnapshots( )

    return

The snapshot will be created in the 'Snapshots' directory in the same place as your 'Data' directory (e.g. C:\PureCM\Snapshots).

You can specify the number of snapshots which will be created using the 'Retained Snapshots' policy. So for example if this is set to 5 then the last 5 days will be stored. When creating the snapshot on the 6th day the 1st snapshot will be deleted.

The 'Retained Snapshots' policy will be included in the 'Default Policyset'. The initial value is 10. You can modify this by going to the 'Policy Admin' tree item in the GUI.

3.4. How do I restore a Snapshot

To restore a database snapshot you will need to use the 'tdbutil' utility which will have been installed with the server (typically 'Program Files\PureCM\Server').

  • Open a command prompt in the server executables directory.
  • Type 'tdbutil import <snapshot> <database>'. For example if you have a repository called 'Test1'. The snapshot file will be called 'r_Test1_1.xml.gz'. In this instance you would type 'tdbutil import r_Test1.xml.gz r_Test1'. This will create the corresponding r_Test1.tdf, r_Test1.tbf, r_Test1.tlf and r_Test1.tpf files. These files should then be copied into the PureCM data directory (typically PureCM\data).

Note : You will need to remove the old log files before restarting your PureCM server -Delete C:\PureCM\logs directory, and all C:\PureCM\data\*.tlf and *.tpf files.

3.5. Archiving the Log File

The location of the log files was set during the server installation (typically PureCM\logs). The number of stored log backups before the oldest one is deleted is set in the 'Stored Log Backups' policy. The log files can then be backed up using a backup program such as NTBackup on Windows or 'tar' on Unix. Applying a log file to recreate the database is described in the section called “Applying the Log File”.

3.6. Applying the Log File

To apply the log files you will need to use the 'tdbutil' utility which will have been installed with the server (typically 'Program Files\PureCM\Server').

  • Open a command prompt in the server executables directory.
  • Type 'tdbutil applylog <database path> <logfile base name>'.

3.7. How do I reduce the number of snapshots stored?

If you look in the default policyset there should be a policy ‘Retained Snapshots’. This will currently be set to 10, so change this the number of snapshots you want to create.

3.8. How do I release the database file locks so I can back them up?

On a command prompt you need to run 'pcm admin begin-backup'. If you have multiple connections then you first need to specify the connection you want pcm to use. If you want to run this command without creating a connection then you can specify the server details manually with the --server, --user and --password flags (type 'pcm help admin begin-backup' for full details).

This will lock the purecm database so other users cannot use it.

You can then take a backup of the PureCM database files.

When the backup is complete you need to run 'pcm admin end-backup' to release the purecm database lock.

Note that you must have the 'Backup Administrator' policy enabled to use these commands.

3.9. What files do I need to backup?

You need to make a backup of all the *.tdf (data files) and *.tbf (binary files) in your data directory. These files should exist for the server database and for each repository database (r_[repos name]).

The *.tlf (log files) and (*.tpf) can be safely deleted after the server has been shut down. You do not need to backup the logs directory either.

Note that you can get PureCM to automatically purge the logs directory using the 'Automatic Log Truncation' policy.

4. Moving the PureCM Server to a Different Machine

4.1. Moving the PureCM Server from one Windows Machine to another Windows Machine

Moving the PureCM server from one Windows machine to another Windows machine is easy. Follow these simple steps:

  • Install PureCM Server on the new Windows machine.
  • Stop the PureCM Server service.
  • Delete the C:\PureCM\data and C:\PureCM\logs directories from the new machine (these will only contain the example data).
  • Copy the C:\PureCM\data and C:\PureCM\logs directories from the old machine to the new machine.
  • Start the PureCM Server service.

4.2. Moving the PureCM Server from a Windows Machine to a Linux Machine

Moving the PureCM server from a Windows machine to a Linux machine is easy, but you need to export the data and reimport it because Linux has case sensitive file paths. Follow these steps:

  • Install PureCM Server on the new Linux machine.
  • Stop the PureCM Server daemon (service purecm-server stop).
  • Delete the /opt/purecm-server/data/* and /opt/purecm-server/logs/* files from the Linux machine (these will only contain the example data).
  • Copy the C:\PureCM\data\* files from the Windows machine to the /opt/purecm-server/data Linux directory.
  • On the Linux machine run '/opt/purecm-server/bin/tdbutil export  /opt/purecm-server/data/r_[repos name] [repos name].xml' for each repository.
  • On the Linux machine delete the /opt/purecm-server/data/r_* files
  • On the Linux machine run '/opt/purecm-server/bin/tdbutil import  [repos name].xml /opt/purecm-server/data/r_[repos name]' for each repository.
  • You do not need to export and import the server database files.

4.3. Moving the PureCM Server from a Windows Machine to a Mac Machine

Moving the PureCM server from a Windows machine to a Mac machine is easy, but you need to export the data and reimport it because the Mac has case sensitive file paths. Follow these steps:

  • Install PureCM Server on the new Mac machine.
  • Stop the PureCM Server daemon (sudo launchctl unload /Library/LaunchDaemons/com.purecm.server.plist).
  • Delete the /usr/bin/purecm-server/data/* and /usr/bin/purecm-server/log/* files from the Mac machine (these will only contain the example data).
  • Copy the C:\PureCM\data\* files from the Windows machine to the /usr/bin/purecm-server/data Mac directory.
  • On the Mac machine run '/usr/bin/purecm-server/bin/tdbutil export  /usr/bin/purecm-server/data/r_[repos name] [repos name].xml' for each repository.
  • On the Mac machine delete the /usr/bin/purecm-server/data/r_* files
  • On the Mac machine run '/usr/bin/purecm-server/bin/tdbutil import  [repos name].xml /usr/purecm-server/data/r_[repos name]' for each repository.
  • You do not need to export and import the server database files.

5. tdbutil - The Database Utility Tool

5.1. What is tdbutil?

When installing the server you will also install the database utility tool 'tdbutil' (e.g. 'C:\Program Files\PureCM\Server\tdbutil.exe').

 

On a command line if you run tdbutil without any parameters then it will list all available commands.

 

Some of the most common commands are:

  • export - To export a database as an xml file. This can be useful because you can change the xml directly and then reimport it to manually change the database.
  • check/fix - This is a quick check to check the overall database integrity.
  • rcheck/rfix - This is a more comprehensive check on a repository database.

5.2. Exporting a Database to an XML File

To run this command you must first stop the PureCM Server (e.g. stop the 'PureCM Service' service on Windows).

Open a command prompt and type: 'tdbutil export --indent [database path] [output file]' (e.g. 'tdbutil export --indent C:\PureCM\Data\r_Example example.xml').

Tdbutil is installed when you install the server.

5.3. tdbutil rcheck and rfix

The 'tdbutil rcheck' command will check a repository database for any inconsistencies. To run this command you must first stop the PureCM Server (e.g. stop the 'PureCM Service' service on Windows). It is then recommended that you take a backup of the C:\PureCM\Data directory.

Open a command prompt and type: 'tdbutil rcheck [repos_database] [server_database]' (e.g. 'tdbutil rcheck C:\PureCM\Data\r_Example C:\PureCM\Data\server').

If the rcheck records any errors then we recommend that you email support@purecm.com with the details. You can fix many errors by running 'tdbutil rfix' with the same parameters. After running rfix you need to remove the C:\PureCM\Logs directory. The database has changed and the logs apply to the old database - so the logs are invalid.

'tdbutil rfix' supports the following flags:

  • --create-empty-revisions : If a revision is found without any data then an empty revision will be created.
  • --correct-hashes : If a revision hash does not match the revision data then the hash will be regenerated.
  • --reencode-invalid-utf8 : If this is set then rfix will read all the data revisions and check they are valid UTF8 (all revision data is stored as UTF8 in the database). If they are not valid UTF8 then they will be reencoded.
  • --deleteorphans : If any file records are found which are not referenced in any folder revisions then the file record and its data is deleted. Orphan files are sometimes created when a stream is deleted and it is correct to delete them using rfix.
  • --createmissingfiles : If a folder revision references a file which does not exist then an empty file record will be created with an empty revision.
  • --update-rev-on-missing-rec : If a folder revision record references a file or folder which does not exist then the reference is deleted from the folder revision record.

5.4. tdbutil resetpolicies

The 'tdbutil resetpolicies' command will reset the policies so everyone has all the administration policies enabled. All your existing policy settings will be deleted. This should only be used as a last resort if you get yourself into a mess with policies (e.g. you delete the only user/group where the 'Policy Administration' policy is enabled).

To run this command you must first stop the PureCM Server (e.g. stop the 'PureCM Service' service on Windows). It is then recommended that you take a backup of the C:\PureCM\Data directory.

Open a command prompt and type: 'tdbutil resetpolcies [server_database]' (e.g. 'tdbutil resetpolicies C:\PureCM\Data\server').

Before you start the server you need to remove the C:\PureCM\Logs directory. The database has changed and the logs apply to the old database - so the logs are invalid.

You are now ready to start the PureCM Server again and change the policies.

5.5. Clearing the 'Workspace Change' table

The 'Workspace Change' table contains all the current changeset on the server (including reviews and shelvesets). The 'Workspace Change Item' table contains all the items for this table.

There have been situations where these tables has become inconsistent. In such situations the quickest fix is to clear them.

 

Before doing this we strongly recommend you make a backup of your PureCM database by stopping the server and taking a backup of the relevant files. If you use reviews then you should ensure that all reviews have been accepted before doing this. If you have any shelveset which you need then you should unshelve them into a temporary workspace so you can reshelve them after. This will remove all locks.

 

To clear these table you need to import the empty tables. To do this open a command prompt and run:

tdbutil import clean_workspace_changes.xml r_[repos_name]

e.g. tdbutil import clean_workspace_changes.xml r_Example. The file 'clean_workspace_changes.xml' is attached.

After doing this you need to delete your log files (c:\purecm\data\*.tlf , c:\purecm\data\*.tpf , c:\purecm\logs\*).

On restarting the server you should see that the all the current changesets have been deleted if you navigate to the streams in the GUI. If you open a workspace the old locks will still appear. To synchronise the workspace with the server you need to right-click the workspace and select 'All Tasks | Refresh Status'.

5.6. tdbutil rcheck/rfix is reporting lots of 'Unable to find change item for file' errors

It is a known issue that under certain circumstances 'tdbutil rcheck' will report the error:

[Error]: Unable to find change item for file ? stream ? rev ?

This error may be reported lots of times. The common circumstance in which this error is generated is after deleting a stream.

It is safe to ignore this errors. You can run 'tdbutil rfix' to remove it.

6. Repository Databases

6.1. Missing Repositories

If, after an upgrade or reboot etc., you find one of your code repositories isn't showing up in the GUI, the most probable explanation is that a database error of some sort occurred during PureCM Server setup.  This can be caused by file corruption, incorrect permissions or possibly lack of memory.  It is also possible that the Administrator has removed your access to the repository.

If this has happened on your server, please contact us by creating a request so that we can help to correct the situation.

7. Exporting PureCM Data

7.1. Is it possible to export data from PureCM into another version control system?

PureCM supports a .NET API and a Java API (new in 2008/2). You can use either of these APIs to create a workspace and iterate through each changeset. For each change you can then submit the edits into the other version control system.

We have written a program which exports data from one PureCM stream and imports it into another. So you will be able to replace the code to import into another PureCM stream with code to import into another version control system. This has been written in .NET and java. See link below for this code.

8. The Workspace Database

8.1. What is the workspace database?

When you create a workspace, PureCM creates a database for the workspace to keep track of which files are being changed, etc. The workspace database will be very small unless you select the 'Store file revisions in the workspace database' option.

If this option is enabled then the workspace database will contain all the file revisions (compressed). The disadvantage with this is that the workspace will take longer to create and the workspace database will be much bigger. The advantage is that you can view previous file revisions without being connected to the server - or even if you are connected to the server you can view them quicker.

Note that if this is not checked PureCM will automatically store the head revision when you checkout a file. So you don't need to go up to the server to see the changes you have made to a file. 

When you create a workspace you have the option of whether to create the workspace database in your home directory.

If you choose to create the database in your home directory then the database files will be created in the path specified in the GUI Options General Page. The database file names will reflect the workspace path.

If you choose not to create the database in your home directory then the workspace will be created with the folder '_purecm' at the workspace root. This will contain all the workspace database files.

Note that you must create the workspace database in the home directory for multi-path workspaces (i.e. workspaces with multiple root folders). In contrast you must NOT create the workspace database in the home directory for multi-user workspaces (i.e. workspaces which are used by multiple developers).

8.2. Fixing the workspace database

There have been times when the workspace database has become inconsistent with the server database - and therefore unusable. Prior to the 2009/2 release, if this happened you would need to delete your existing workspace (without deleting the files) and create a new workspace over the top of your existing files. You can then run 'Check Consistency' to pick up any changes you had made in the workspace. The problem with this is that it can be very slow.

2009/2 introduced the 'All Tasks | Fix Workspace' menu. What this does is to recreate you workspace database, which will be very quick. You then need to run 'Update to Latest' which will update your workspace with the latest files and check all files out. You can then run 'Revert Unchanged Files' to identiy which files you were working on in the workspace. This is much quicker because it only downloads the files which have changed.