diff --git a/catalogue/CMakeLists.txt b/catalogue/CMakeLists.txt
index 2730b160af60aea5067bb64abc7609db9dcbc255..e7b729f5bea584e175e2cfbc9667992d8f3378fc 100644
--- a/catalogue/CMakeLists.txt
+++ b/catalogue/CMakeLists.txt
@@ -78,7 +78,7 @@ add_library (ctainmemorycatalogueunittests SHARED
 target_link_libraries (ctainmemorycatalogueunittests
   ctacatalogue)
 
-install(TARGETS ctainmemorycatalogueunittests DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
+install (TARGETS ctainmemorycatalogueunittests DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
 
 set (CATALOGUE_UNIT_TESTS_LIB_SRC_FILES
   CatalogueTest.cpp
@@ -90,7 +90,7 @@ add_library (ctacatalogueunittests SHARED
 target_link_libraries (ctacatalogueunittests
   ctacatalogue)
 
-install(TARGETS ctacatalogueunittests DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
+install (TARGETS ctacatalogueunittests DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
 
 install (FILES cta_catalogue_db.conf.example
   DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/cta
@@ -104,7 +104,7 @@ add_executable(cta-catalogue-schema-lock
 target_link_libraries (cta-catalogue-schema-lock
   ctacatalogue)
 
-install(TARGETS cta-catalogue-schema-lock DESTINATION /usr/bin)
+install (TARGETS cta-catalogue-schema-lock DESTINATION /usr/bin)
 install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/cta-catalogue-schema-lock.1cta DESTINATION /usr/share/man/man1)
 
 add_executable(cta-catalogue-schema-unlock
@@ -115,7 +115,7 @@ add_executable(cta-catalogue-schema-unlock
 target_link_libraries (cta-catalogue-schema-unlock
   ctacatalogue)
 
-install(TARGETS cta-catalogue-schema-unlock DESTINATION /usr/bin)
+install (TARGETS cta-catalogue-schema-unlock DESTINATION /usr/bin)
 install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/cta-catalogue-schema-unlock.1cta DESTINATION /usr/share/man/man1)
 
 add_executable(cta-catalogue-schema-status
@@ -126,5 +126,16 @@ add_executable(cta-catalogue-schema-status
 target_link_libraries (cta-catalogue-schema-status
   ctacatalogue)
 
-install(TARGETS cta-catalogue-schema-status DESTINATION /usr/bin)
+install (TARGETS cta-catalogue-schema-status DESTINATION /usr/bin)
 install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/cta-catalogue-schema-status.1cta DESTINATION /usr/share/man/man1)
+
+add_executable(cta-catalogue-delete-all-data
+  DeleteAllCatalogueDataCmd.cpp
+  DeleteAllCatalogueDataCmdLineArgs.cpp
+  DeleteAllCatalogueDataCmdMain.cpp)
+
+target_link_libraries (cta-catalogue-delete-all-data
+  ctacatalogue)
+
+install (TARGETS cta-catalogue-delete-all-data DESTINATION /usr/bin)
+install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/cta-catalogue-delete-all-data.1cta DESTINATION /usr/share/man/man1)
diff --git a/catalogue/DeleteAllCatalogueDataCmd.cpp b/catalogue/DeleteAllCatalogueDataCmd.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..a39a9c3dee7c6c787e685e1067ec8ac05b76c0f4
--- /dev/null
+++ b/catalogue/DeleteAllCatalogueDataCmd.cpp
@@ -0,0 +1,211 @@
+/*
+ * The CERN Tape Archive (CTA) project
+ * Copyright (C) 2015  CERN
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "catalogue/CatalogueFactory.hpp"
+#include "catalogue/DeleteAllCatalogueDataCmd.hpp"
+#include "catalogue/DeleteAllCatalogueDataCmdLineArgs.hpp"
+#include "common/exception/Exception.hpp"
+
+namespace cta {
+namespace catalogue {
+
+//------------------------------------------------------------------------------
+// constructor
+//------------------------------------------------------------------------------
+DeleteAllCatalogueDataCmd::DeleteAllCatalogueDataCmd(
+  std::istream &inStream,
+  std::ostream &outStream,
+  std::ostream &errStream):
+  CmdLineTool(inStream, outStream, errStream) {
+}
+
+//------------------------------------------------------------------------------
+// destructor
+//------------------------------------------------------------------------------
+DeleteAllCatalogueDataCmd::~DeleteAllCatalogueDataCmd() noexcept {
+}
+
+//------------------------------------------------------------------------------
+// exceptionThrowingMain
+//------------------------------------------------------------------------------
+int DeleteAllCatalogueDataCmd::exceptionThrowingMain(const int argc, char *const *const argv) {
+  const DeleteAllCatalogueDataCmdLineArgs cmdLineArgs(argc, argv);
+  const auto dbLogin = rdbms::Login::parseFile(cmdLineArgs.dbConfigPath);
+  const uint64_t nbDbConns = 1;
+  auto catalogue = CatalogueFactory::create(dbLogin, nbDbConns);
+
+  if(catalogue->schemaIsLocked()) {
+    m_err <<
+      "Cannot delete the data in the catalogue because the schema is locked.\n"
+      "\n"
+      "Please see the following command-line tools:\n"
+      "    cta-catalogue-schema-lock\n"
+      "    cta-catalogue-schema-status\n"
+      "    cta-catalogue-schema-unlock" << std::endl;
+    return 1;
+  }
+  deleteAllRowsExceptForCTA_CATALOGUE(*catalogue);
+
+  return 0;
+}
+
+//------------------------------------------------------------------------------
+// deleteAllRowsExceptForCTA_CATALOGUE
+//------------------------------------------------------------------------------
+void DeleteAllCatalogueDataCmd::deleteAllRowsExceptForCTA_CATALOGUE(Catalogue &catalogue) {
+  deleteAdminUsers(catalogue);
+  deleteAdminHosts(catalogue);
+  deleteArchiveRoutes(catalogue);
+  deleteRequesterMountRules(catalogue);
+  deleteRequesterGroupMountRules(catalogue);
+  deleteArchiveAndTapeFiles(catalogue);
+  deleteTapes(catalogue);
+  deleteStorageClasses(catalogue);
+  deleteTapePools(catalogue);
+  deleteLogicalLibrares(catalogue);
+  deleteMountPolicies(catalogue);
+}
+
+//------------------------------------------------------------------------------
+// deleteAdminUsers
+//------------------------------------------------------------------------------
+void DeleteAllCatalogueDataCmd::deleteAdminUsers(Catalogue &catalogue) {
+  const std::list<common::dataStructures::AdminUser> adminUsers = catalogue.getAdminUsers();
+  for(auto &adminUser: adminUsers) {
+    catalogue.deleteAdminUser(adminUser.name);
+  }
+  m_out << "Deleted " << adminUsers.size() << " admin users" << std::endl;
+}
+
+//------------------------------------------------------------------------------
+// deleteAdminHosts
+//------------------------------------------------------------------------------
+void DeleteAllCatalogueDataCmd::deleteAdminHosts(Catalogue &catalogue) {
+  const std::list<common::dataStructures::AdminHost> adminHosts = catalogue.getAdminHosts();
+  for(auto &adminHost: adminHosts) {
+    catalogue.deleteAdminHost(adminHost.name);
+  }
+  m_out << "Deleted " << adminHosts.size() << " admin hosts" << std::endl;
+}
+
+//------------------------------------------------------------------------------
+// deleteArchiveRoutes
+//------------------------------------------------------------------------------
+void DeleteAllCatalogueDataCmd::deleteArchiveRoutes(Catalogue &catalogue) {
+  const std::list<common::dataStructures::ArchiveRoute> archiveRoutes = catalogue.getArchiveRoutes();
+  for(auto &archiveRoute: archiveRoutes) {
+    catalogue.deleteArchiveRoute(archiveRoute.diskInstanceName, archiveRoute.storageClassName,
+      archiveRoute.copyNb);
+  }
+  m_out << "Deleted " << archiveRoutes.size() << " archive routes" << std::endl;
+}
+
+//------------------------------------------------------------------------------
+// delelteAllRequesterMountRules
+//------------------------------------------------------------------------------
+void DeleteAllCatalogueDataCmd::deleteRequesterMountRules(Catalogue &catalogue) {
+  const std::list<common::dataStructures::RequesterMountRule> rules = catalogue.getRequesterMountRules();
+  for(auto &rule: rules) {
+    catalogue.deleteRequesterMountRule(rule.diskInstance, rule.name);
+  }
+  m_out << "Deleted " << rules.size() << " requester mount-rules" << std::endl;
+}
+
+//------------------------------------------------------------------------------
+// deleteRequesterGroupMountRules
+//------------------------------------------------------------------------------
+void DeleteAllCatalogueDataCmd::deleteRequesterGroupMountRules(Catalogue &catalogue) {
+  const std::list<common::dataStructures::RequesterGroupMountRule> rules =
+    catalogue.getRequesterGroupMountRules();
+  for(auto &rule: rules) {
+    catalogue.deleteRequesterGroupMountRule(rule.diskInstance, rule.name);
+  }
+  m_out << "Deleted " << rules.size() << " requester-group mount-rules" << std::endl;
+}
+
+//------------------------------------------------------------------------------
+// deleteArchiveAndTapeFiles
+//------------------------------------------------------------------------------
+void DeleteAllCatalogueDataCmd::deleteArchiveAndTapeFiles(Catalogue &catalogue) {
+  std::unique_ptr<ArchiveFileItor> itor = catalogue.getArchiveFileItor();
+  uint64_t nbArchiveFiles = 0;
+  while(itor->hasMore()) {
+    const auto archiveFile = itor->next();
+    catalogue.deleteArchiveFile(archiveFile.diskInstance, archiveFile.archiveFileID);
+    nbArchiveFiles++;
+  }
+  m_out << "Deleted " << nbArchiveFiles << " archive files and their associated tape copies" << std::endl;
+}
+
+//------------------------------------------------------------------------------
+// deleteTapes
+//------------------------------------------------------------------------------
+void DeleteAllCatalogueDataCmd::deleteTapes(Catalogue &catalogue) {
+  const std::list<common::dataStructures::Tape> tapes = catalogue.getTapes();
+  for(auto &tape: tapes) {
+    catalogue.deleteTape(tape.vid);
+  }
+  m_out << "Deleted " << tapes.size() << " tapes" << std::endl;
+}
+
+//------------------------------------------------------------------------------
+// deleteStorageClasses
+//------------------------------------------------------------------------------
+void DeleteAllCatalogueDataCmd::deleteStorageClasses(Catalogue &catalogue) {
+  const std::list<common::dataStructures::StorageClass> storageClasses = catalogue.getStorageClasses();
+  for(auto &storageClass: storageClasses) {
+    catalogue.deleteStorageClass(storageClass.diskInstance, storageClass.name);
+  }
+  m_out << "Deleted " << storageClasses.size() << " storage classes" << std::endl;
+}
+
+//------------------------------------------------------------------------------
+// deleteTapePools
+//------------------------------------------------------------------------------
+void DeleteAllCatalogueDataCmd::deleteTapePools(Catalogue &catalogue) {
+  const std::list<common::dataStructures::TapePool> tapePools = catalogue.getTapePools();
+  for(auto &tapePool: tapePools) {
+    catalogue.deleteTapePool(tapePool.name);
+  }
+  m_out << "Deleted " << tapePools.size() << " tape pools" << std::endl;
+}
+
+//------------------------------------------------------------------------------
+// deleteLogicalLibraries
+//------------------------------------------------------------------------------
+void DeleteAllCatalogueDataCmd::deleteLogicalLibrares(Catalogue &catalogue) {
+  const std::list<common::dataStructures::LogicalLibrary> logicalLibraries = catalogue.getLogicalLibraries();
+  for(auto &logicalLibrary: logicalLibraries) {
+    catalogue.deleteLogicalLibrary(logicalLibrary.name);
+  }
+  m_out << "Deleted " << logicalLibraries.size() << " logical libraries" << std::endl;
+}
+
+//------------------------------------------------------------------------------
+// deleteMountPolicies
+//------------------------------------------------------------------------------
+void DeleteAllCatalogueDataCmd::deleteMountPolicies(Catalogue &catalogue) {
+  const std::list<common::dataStructures::MountPolicy> mountPolicies = catalogue.getMountPolicies();
+  for(auto &mountPolicy: mountPolicies) {
+    catalogue.deleteMountPolicy(mountPolicy.name);
+  }
+  m_out << "Deleted " << mountPolicies.size() << " mount policies" << std::endl;
+}
+
+} // namespace catalogue
+} // namespace cta
diff --git a/catalogue/DeleteAllCatalogueDataCmd.hpp b/catalogue/DeleteAllCatalogueDataCmd.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..9a839e899d0fe1c4c050da3567a801e525cd1c74
--- /dev/null
+++ b/catalogue/DeleteAllCatalogueDataCmd.hpp
@@ -0,0 +1,149 @@
+/*
+ * The CERN Tape Archive (CTA) project
+ * Copyright (C) 2015  CERN
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#pragma once
+
+#include "catalogue/Catalogue.hpp"
+#include "catalogue/CmdLineTool.hpp"
+
+namespace cta {
+namespace catalogue {
+
+/**
+ * Command-line tool that deletes all the rows of all the tables in the
+ * catalogue database except for the CTA_CATALOGUE table.
+ */
+class DeleteAllCatalogueDataCmd: public CmdLineTool {
+public:
+
+  /**
+   * Constructor.
+   *
+   * @param inStream Standard input stream.
+   * @param outStream Standard output stream.
+   * @param errStream Standard error stream.
+   */
+  DeleteAllCatalogueDataCmd(std::istream &inStream, std::ostream &outStream, std::ostream &errStream);
+
+  /**
+   * Destructor.
+   */
+  ~DeleteAllCatalogueDataCmd() noexcept;
+
+  /**
+   * An exception throwing version of main().
+   *
+   * @param argc The number of command-line arguments including the program name.
+   * @param argv The command-line arguments.
+   * @return The exit value of the program.
+   */
+  int exceptionThrowingMain(const int argc, char *const *const argv);
+
+private:
+
+  /**
+   * Deletes all of the rows of all of the tables in the specified catalogue
+   * database except for the CTA_CATALOGUE table.
+   *
+   * @param catalogue The catalogue database.
+   */
+  void deleteAllRowsExceptForCTA_CATALOGUE(Catalogue &catalogue);
+
+  /**
+   * Deletes all admin users from the specified catalogue database.
+   *
+   * @param catalogue The catalogue database.
+   */
+  void deleteAdminUsers(Catalogue &catalogue);
+
+  /**
+   * Deletes all admin hosts from the specified catalogue database.
+   *
+   * @param catalogue The catalogue database.
+   */
+  void deleteAdminHosts(Catalogue &catalogue);
+
+  /**
+   * Deletes all archive routes from the specified catalogue database.
+   *
+   * @param catalogue The catalogue database.
+   */
+  void deleteArchiveRoutes(Catalogue &catalogue);
+
+  /**
+   * Deletes all requester mount-rules from the specified catalogue database.
+   *
+   * @param catalogue The catalogue database.
+   */
+  void deleteRequesterMountRules(Catalogue &catalogue);
+
+  /**
+   * Deletes all requester-group mount-rules from the specified catalogue
+   * database.
+   *
+   * @param catalogue The catalogue database.
+   */
+  void deleteRequesterGroupMountRules(Catalogue &catalogue);
+
+  /**
+   * Deletes all archive files and their associated tape files from the
+   * specified catalogue database.
+   *
+   * @param catalogue The catalogue database.
+   */
+  void deleteArchiveAndTapeFiles(Catalogue &catalogue);
+
+  /**
+   * Deletes all tapes from the specified catalogue database.
+   *
+   * @param catalogue The catalogue database.
+   */
+  void deleteTapes(Catalogue &catalogue);
+
+  /**
+   * Deletes all storage classes from the specified catalogue database.
+   *
+   * @param catalogue The catalogue database.
+   */
+  void deleteStorageClasses(Catalogue &catalogue);
+
+  /**
+   * Deletes all tape pools from the specified catalogue database.
+   *
+   * @param catalogue The catalogue database.
+   */
+  void deleteTapePools(Catalogue &catalogue);
+
+  /**
+   * Deletes all logical libraries from the specified catalogue database.
+   *
+   * @param catalogue The catalogue database.
+   */
+  void deleteLogicalLibrares(Catalogue &catalogue);
+
+  /**
+   * Deletes all mount policies from the specified catalogue database.
+   *
+   * @param catalogue The catalogue database.
+   */
+  void deleteMountPolicies(Catalogue &catalogue);
+
+}; // class DeleteAllCatalogueDataCmd
+
+} // namespace catalogue
+} // namespace cta
diff --git a/catalogue/DeleteAllCatalogueDataCmdLineArgs.cpp b/catalogue/DeleteAllCatalogueDataCmdLineArgs.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..f8812389b17130cf78a61bf038e6eb73d009c3c5
--- /dev/null
+++ b/catalogue/DeleteAllCatalogueDataCmdLineArgs.cpp
@@ -0,0 +1,55 @@
+/*
+ * The CERN Tape Archive (CTA) project
+ * Copyright (C) 2015  CERN
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "catalogue/DeleteAllCatalogueDataCmdLineArgs.hpp"
+#include "common/exception/Exception.hpp"
+
+#include <ostream>
+
+namespace cta {
+namespace catalogue {
+
+//------------------------------------------------------------------------------
+// constructor
+//------------------------------------------------------------------------------
+DeleteAllCatalogueDataCmdLineArgs::DeleteAllCatalogueDataCmdLineArgs(const int argc, const char *const *const argv) {
+  if(argc != 2) {
+    exception::Exception ex;
+    ex.getMessage() << "Wrong number of command-line arguments: excepted=1 actual=" << (argc - 1) << std::endl <<
+      std::endl;
+    printUsage(ex.getMessage());
+    throw ex;
+  }
+  dbConfigPath = argv[1];
+}
+
+//------------------------------------------------------------------------------
+// printUsage
+//------------------------------------------------------------------------------
+void DeleteAllCatalogueDataCmdLineArgs::printUsage(std::ostream &os) {
+  os <<
+    "Usage:" << std::endl <<
+    "    cta-catalogue-delete-all-data databaseConnectionFile" << std::endl <<
+    "Where:" << std::endl <<
+    "    databaseConnectionFile" << std::endl <<
+    "        The path to the file containing the connection details of the CTA" << std::endl <<
+    "        catalogue database" << std::endl;
+}
+
+} // namespace catalogue
+} // namespace cta
diff --git a/catalogue/DeleteAllCatalogueDataCmdLineArgs.hpp b/catalogue/DeleteAllCatalogueDataCmdLineArgs.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..397ee4573435a04a9687ea225feff8dbbc83302e
--- /dev/null
+++ b/catalogue/DeleteAllCatalogueDataCmdLineArgs.hpp
@@ -0,0 +1,53 @@
+/*
+ * The CERN Tape Archive (CTA) project
+ * Copyright (C) 2015  CERN
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <string>
+
+namespace cta {
+namespace catalogue {
+
+/**
+ * Structure to store the command-line arguments of the command-line tool
+ * named cta-catalogue-delete-all-data.
+ */
+struct DeleteAllCatalogueDataCmdLineArgs {
+  /**
+   * Path to the file containing the connection details of the catalogue
+   * database.
+   */
+  std::string dbConfigPath;
+
+  /**
+   * Constructor that parses the specified command-line arguments.
+   *
+   * @param argc The number of command-line arguments including the name of the
+   * executable.
+   * @param argv The vector of command-line arguments.
+   */
+  DeleteAllCatalogueDataCmdLineArgs(const int argc, const char *const *const argv);
+
+  /**
+   * Prints the usage message of the command-line tool.
+   *
+   * @param os The output stream to which the usage message is to be printed.
+   */
+  static void printUsage(std::ostream &os);
+};
+
+} // namespace catalogue
+} // namespace cta
diff --git a/catalogue/DeleteAllCatalogueDataCmdMain.cpp b/catalogue/DeleteAllCatalogueDataCmdMain.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..f357306e486e234641b85f3df13006084073f52d
--- /dev/null
+++ b/catalogue/DeleteAllCatalogueDataCmdMain.cpp
@@ -0,0 +1,67 @@
+/*
+ * The CERN Tape Archive (CTA) project
+ * Copyright (C) 2015  CERN
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "catalogue/DeleteAllCatalogueDataCmd.hpp"
+#include "common/exception/Exception.hpp"
+
+#include <iostream>
+
+/**
+ * An exception throwing version of main().
+ *
+ * @param argc The number of command-line arguments including the program name.
+ * @param argv The command-line arguments.
+ * @return The exit value of the program.
+ */
+static int exceptionThrowingMain(const int argc, char *const *const argv);
+
+//------------------------------------------------------------------------------
+// main
+//------------------------------------------------------------------------------
+int main(const int argc, char *const *const argv) {
+  using namespace cta;
+
+  std::string errorMessage;
+
+  try {
+    return exceptionThrowingMain(argc, argv);
+  } catch(exception::Exception &ex) {
+    errorMessage = ex.getMessage().str();
+  } catch(std::exception &se) {
+    errorMessage = se.what();
+  } catch(...) {
+    errorMessage = "An unknown exception was thrown";
+  }
+
+  // Reaching this point means the command has failed, an exception was throw
+  // and errorMessage has been set accordingly
+
+  std::cerr << "Aborting: " << errorMessage << std::endl;
+  return 1;
+}
+
+//------------------------------------------------------------------------------
+// exceptionThrowingMain
+//------------------------------------------------------------------------------
+static int exceptionThrowingMain(const int argc, char *const *const argv) {
+  using namespace cta;
+
+  catalogue::DeleteAllCatalogueDataCmd cmd(std::cin, std::cout, std::cerr);
+
+  return cmd.exceptionThrowingMain(argc, argv);
+}
diff --git a/catalogue/cta-catalogue-delete-all-data.1cta b/catalogue/cta-catalogue-delete-all-data.1cta
new file mode 100644
index 0000000000000000000000000000000000000000..7f4c50b2c0cf1c56c375d43b06b3cf3fc59f65c1
--- /dev/null
+++ b/catalogue/cta-catalogue-delete-all-data.1cta
@@ -0,0 +1,40 @@
+.\" The CERN Tape Archive (CTA) project
+.\" Copyright (C) 2015  CERN
+.\"
+.\" This program is free software: you can redistribute it and/or modify
+.\" it under the terms of the GNU General Public License as published by
+.\" the Free Software Foundation, either version 3 of the License, or
+.\" (at your option) any later version.
+.\"
+.\" This program is distributed in the hope that it will be useful,
+.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
+.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+.\" GNU General Public License for more details.
+.\"
+.\" You should have received a copy of the GNU General Public License
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
+.TH CTA-CATALOGUE-SCHEMA-LOCK 1CTA "November 2016" CTA CTA
+.SH NAME
+cta-catalogue-delete-all-data \- Delete all data in the CTA catalogue
+.SH SYNOPSIS
+.BI "cta-catalogue-delete-all-data databaseConnectionFile"
+
+.SH DESCRIPTION
+\fBcta-catalogue-delete-all-data\fP is a command-line tool that deletes all the
+rows of all the tables in the catalogue database except for the CTA_CATALOGUE
+table.
+.P
+This command-line tool will abort if it sees the value LOCKED in the
+SCHEMA_STATUS column of the CTA_CATALOGUE database table.
+.SH ARGUMENTS
+.TP
+\fBdatabaseConnectionFile
+The path to the configuration file containing the connection details of the
+CTA catalogue database.
+.SH RETURN VALUE
+Zero on success and non-zero on failure.
+.SH EXAMPLES
+cta-catalogue-delete-all-data /etc/cta/cta_catalogue_db.conf
+
+.SH AUTHOR
+\fBCTA\fP Team
diff --git a/cta.spec.in b/cta.spec.in
index 00f7b7397dc9b0a736925ee60536cb6775ddbe84..020f1157bec3b5ae0ff036f24ef12a90bfe77d8e 100644
--- a/cta.spec.in
+++ b/cta.spec.in
@@ -232,9 +232,11 @@ Group: Application/CTA
 CERN Tape Archive:
 Scripts and utilities to faciliate working with the CTA catalogue
 %files -n cta-catalogueutils
+%attr(0755,root,root) %{_bindir}/cta-catalogue-delete-all-data
 %attr(0755,root,root) %{_bindir}/cta-catalogue-schema-lock
 %attr(0755,root,root) %{_bindir}/cta-catalogue-schema-status
 %attr(0755,root,root) %{_bindir}/cta-catalogue-schema-unlock
+%attr(0644,root,bin) %doc /usr/share/man/man1/cta-catalogue-delete-all-data.1cta.gz
 %attr(0644,root,bin) %doc /usr/share/man/man1/cta-catalogue-schema-lock.1cta.gz
 %attr(0644,root,bin) %doc /usr/share/man/man1/cta-catalogue-schema-status.1cta.gz
 %attr(0644,root,bin) %doc /usr/share/man/man1/cta-catalogue-schema-unlock.1cta.gz