Author Topic: How to backup and restore the Wiki database  (Read 5993 times)

Francesco DellaPorta

  • Newbie
  • *
  • Posts: 14
    • View Profile
How to backup and restore the Wiki database
« on: March 28, 2014, 07:12:34 AM »
Mapping a backup and restore command-line procedure from OS X Server Mountain Lion leads to archiver database error.

Below there is the set of commands which should be able to backup first and, if so required, to restore the Wiki (collab) database.

# Backup Wiki
sudo pg_dump -h /Library/Server/Wiki/PostgresSocket -Fc -Z9 -b -U _teamsserver collab -f /tmp/collab.pgdatabase

# Restore Wiki
sudo pg_restore -h /Library/Server/Wiki/PostgresSocket -1 -U _teamsserver -d collab /tmp/collab.pgdatabase

Both commands have been adapted to match the changes on OS X 10.9.2 and Server 3.1.1 (PostgreSQL 9.2.4). Before restoring the database, the Wiki service needs to be stopped, and hence later restarted. If successful, the backup command returns no standard output. The restore command instead gives an error output:

pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 762; 1247 16905 TYPE acl_action collab
pg_restore: [archiver (db)] could not execute query: ERROR:  type "acl_action" already exists
    Command was: CREATE TYPE acl_action AS ENUM (
    'read',
    'write',
    'delete',
    'own',
    '*'
);

Once cleared, this procedure may well be integrated in the second book "Mavericks Server - Control and Collaboration".

Reid Bundonis

  • Administrator
  • Full Member
  • *****
  • Posts: 107
    • View Profile
Re: How to backup and restore the Wiki database
« Reply #1 on: March 28, 2014, 07:23:16 AM »
Awesome!  Thanks.  Next week I need to take a Wiki from 10.6.8 to 10.9.2.  This is very timely and appreciated!

By the way, with your great edits I should have version 1.3 posted to Apple for review this weekend.  And the second book is making progress.  Slow but getting there.  In the middle of a SAN upgrade that is consuming all my attention.  So far so good.  Waiting for a bug to jump up and bite.

Francesco DellaPorta

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: How to backup and restore the Wiki database
« Reply #2 on: March 28, 2014, 12:24:39 PM »
Servus!
Oh, then migration is up for next week. Just for preparation check out this thread, if not done yet.
https://discussions.apple.com/thread/5472957

Looking for reading and learning next book on Control & Collaboration.