The procedure used to update or restore a TDPS is the same. If you would like to move the server to a new location, the server must be restored at the new location. With that said, it is also necessary to use the procedure to update or restore a TDPS in that scenario

Backup and Restoration

All you need to reconstruct your TeamDrive Personal Server (TDPS), in the case of, for example, a total failure of your hard disk, is the repository and the configuration file. For this reason it is essential to regularly backup these two components. We also recommend backing up these components before performing an update. The TDPS administrator is responsible for the security of TeamDrive Space data stored on a Teamdrive Personal Server. In the following section we will discuss backup and restoration procedures for the repository data directory.

Backing Up the TDPS

The simplest way to make a backup is to shutdown the TDPS and make a complete copy of the repository data directory (referenced by the “repository-data” system parameter). You may also wish to make backups of the configuration file (“tdps.config”) and “mime.types” if you have modified this file. Of course, instead of a complete copy, “rsync” can be used to update an existing backup.

Online Backup

If your availability requirements do not allow the server to be shutdown, an online backup can be performed. The procedure for creating an online backup is as follows:
  1. For each Space (numbered directories) in the repository data directory, do the following:
  2. Backup the log files in the protolog sub-directory as follows:
  3. Lock the file called “last.log”, if it exists (additional software required).
  4. Scan the directory and determine the highest numbered log file.
  5. Backup the “last.log” file.
  6. Unlock the “last.log” file (additional software required).
  7. Backup all numbered log files with a number equal to or less than the highest number found in the previous step.
  8. Additionally, backup all files in the data sub-directory.
  9. Finally, backup all remaining files in the repository data directory.

Restoring a TeamDrive Personal Server

A restore can only be done offline. Even if only part of the space repository is restored, TeamDrive Personal Server will run the recovery procedure for the entire repository. This is not an issue because the clients can recognize if a Space has not changed after the restoration process and will continue to use the Space as it did before.

Follow this procedure to restore the repository data directory:

  1. Shutdown the TeamDrive Personal Server.
  2. Replace the repository data directory with your backup.
  3. As mentioned above, you may also restore Space directories selectively.
  4. Start the TeamDrive Personal Server with the –restored option.
    • This can be done through the “Command Prompt” or “Terminal”.
    • As an alternative to the –restored option, creating an empty file (a file with no extension) in the repository data directory called “restored” will have the same effect.
    • The path to the data directory (repository) can be found in the file “tdps.config”.
  5. The TeamDrive Personal Server will recover all Spaces in the repository before it allows any client connections.

If the TeamDrive Personal Server is stopped during the recovery process it will automatically resume the recovery process when it starts again.

Post Restore

After the recovery, a file called “restore-state” will be created. The “restore-state” file contains the information relevant to the restore procedure.

If recovery is in progress, and you would like for the TDPS to start the recovery again from the beginning (for example, because you have restored different data), then remove this file and start the TeamDrive Personal Server with the –restored option again.

During recovery, the TDPS scans each space and determines the current log offset. It writes this information to a file called “restore-state” in the Space.
It also increments the global “restore-id”. The “restore-id” is the time of the restore in seconds from 01-01-2010.

TeamDrive Client Space Recovery

TeamDrive client Space recovery occurs automatically if necessary. The TeamDrive client software checks the restore state of a Space if the client’s local “restore-id” of a Space is not equal to that of the global “restore-id” on the server.

If the client’s log offset is beyond the server side offset (after the restore), the client will begin local recovery of the Space. The client recovers a Space by resetting the local copy of the space to the state of the Space at the time of the restore (as it was on the server).

Before this is done, a backup copy of the local space data is made. The user is then responsible to check if there are any local changes to the Space in the backup, but not in the Space. The user should then apply these changes to the Space, for example, by copying over the changed files. Some coordination with other users of the Space may be required to prevent duplicating this procedure.

Please feel free to contact us with regard to any additional assistance needed with the procedure to update or restore a TDPS.