Backing up and restoring KnowledgeTree

From KnowledgeTree Document Management Made Simple

Jump to: navigation, search

Contents

Backing up KnowledgeTree

There are four components to backing up KnowledgeTree - the database, the documents, the configuration, and the application.

The database

The mysqldump(Included in KnowledgeTree Stack Installers) or phpMyAdmin programs can be used to export the database into a SQL file. Be sure to disable foreign key checks in the export. The default database name is dms. Back up this exported file.

Using mysqldump in Microsoft Windows:

To save your database to a file (e.g. dump.sql) follow these instructions:

  1. Click Start, then Run
  2. Type in cmd in the run dialog
  3. Browse to the following location: KnowledgeTree_Directory\mysql\bin
  4. Enter in the following command: mysqldump -u dmsadmin -p dms > dump.sql
  5. You will now be prompted for a password, enter the MySQL password you set during your KnowledgeTree installation.
  6. This will save the database to dump.sql, make sure you keep this file in a safe place

Using mysqldump in Linux:

To save your database to a file (e.g. dump.sql) follow these instructions:

  1. Open a terminal
  2. Browse to the following location: KnowledgeTree_Directory/mysql/bin
  3. Enter in the following command: ./mysqldump --socket=../tmp/mysql.sock -u dmsadmin -p dms > dump.sql
  4. You will now be prompted for a password, enter the MySQL password you set during your KnowledgeTree installation.
  5. This will save the database to dump.sql, make sure you keep this file in a safe place

The documents

The documents are stored in the Documents directory in KnowledgeTree. In the KnowledgeTree Stack (which bundles KnowledgeTree with all associated programs), this directory is in the root of the KnowledgeTree stack install. In the open source standalone install, this defaults to the var/Documents directory (but should be changed). Use any filesystem backup system to back this up.

The configuration

The configuration resides in the config.ini file. In the KnowledgeTree Stack, this lives in the root of the stack install root. In the open source standalone install, this defaults to the config/config.ini file.

The application

Even though this can be reinstalled from the original installation material, keeping the application backed up improves restore time and makes it possible to restore should you lose the original installation material. Use any filesystem backup system to back this up.

Restoring KnowledgeTree

Documents, configuration, and application

Restore from the filesystem backup system that these were backed up to.

Database

Use the mysql or phpMyAdmin programs to import the exported SQL file.

Note: If you are restoring to a fresh Stack Installation you will need to drop and recreate the dms database before importing the sql dump. For instruction on how to do this see the section titled Creating a new database at the end of this document.

Using mysqldump in Microsoft Windows:

To restore your database from a file (e.g. dump.sql) follow these instructions:

  1. Click Start, then Run
  2. Enter in cmd in the run dialog
  3. Browse to the following location: KnowledgeTree_Directory\mysql\bin
  4. Enter in the following command: mysql.exe -u dmsadmin -p dms < dump.sql
  5. You will now be prompted for a password, enter the MySQL password you set during your KnowledgeTree installation.

Using mysqldump in Linux:

To restore your database from a file (e.g. dump.sql) follow these instructions:

  1. Open a terminal
  2. Browse to the following location: KnowledgeTree_Directory/mysql/bin
  3. Enter in the following command: ./mysql --socket=../tmp/mysql.sock -u dmsadmin -p dms < dump.sql
  4. You will now be prompted for a password, enter the MySQL password you set during your KnowledgeTree installation.

Creating a new database - Windows

  • Use this command to drop the database (WARNING: Performing this step on a full database may result in data loss!):

./mysqladmin -u dmsadmin -p drop dms

  • Recreate the DMS database:

./mysqladmin -u dmsadmin -p create dms

Creating a new database - Linux

  • Use this command to drop the database (WARNING: Performing this step on a full database may result in data loss!):

./mysqladmin --socket=../tmp/mysql.sock -u dmsadmin -p drop dms

  • Recreate the DMS database:

./mysqladmin --socket=../tmp/mysql.sock -u dmsadmin -p create dms

Personal tools