This discussion is locked
jmacalister

Q: How can I reset/wipe/delete all my wiki content?

I would like to start my Wiki again from emply blank content without having to reinstall the entire lion server.

Mac mini, Mac OS X (10.7.3), Lion Server

Posted on Feb 12, 2012 3:04 AM

Close

Q: How can I reset/wipe/delete all my wiki content?

  • All replies
  • Helpful answers

  • by jmacalister,Solvedanswer

    jmacalister jmacalister Feb 18, 2012 10:12 AM in response to jmacalister
    Level 1 (4 points)
    Feb 18, 2012 10:12 AM in response to jmacalister

    I found this which enabled me to execute SQL from terminal

     

    http://krypted.com/iphone/working-with-postgres-from-the-command-line-in-lion-se rver/

     

    But then found this & connected successfully with a 30 day trial of Navicat

     

    http://www.mactasia.co.uk/revisited-using-postgresql-in-lion-server

     

    I searched my Collab wiki database & removed all UID entries for my corrupted wikis & then deleted the corrupted wikis themselves.

     

    Everything is running perfectly now

     

     

  • by Xavier Laville,Helpful

    Xavier Laville Xavier Laville Mar 6, 2012 2:49 PM in response to jmacalister
    Level 1 (10 points)
    Mar 6, 2012 2:49 PM in response to jmacalister

    Here is a set of TERMINAL commands that will reset our Mac OSX Lion Server Wiki. Take care, all posts will be deleted. You will restart with a clean wiki database:

     

    sudo serveradmin stop postgres

    sudo mv /var/pgsql /var/pgsqlold

    sudo mkdir /var/pgsql

    sudo chmod 700 /var/pgsql

    sudo chown _postgres:_postgres /var/pgsql

    sudo /System/Library/ServerSetup/CleanInstallExtras/01_PostgreSQLSetup.rb

    sudo serveradmin fullstatus postgres

    sudo serveradmin start postgres

  • by Steven Bytnar,

    Steven Bytnar Steven Bytnar Apr 22, 2012 7:15 AM in response to Xavier Laville
    Level 1 (0 points)
    Apr 22, 2012 7:15 AM in response to Xavier Laville

    Those terminal commands will wipe out all of the databases, not just the Wiki.

    bash-3.2# psql -l -U _postgres

                                        List of databases

           Name        |   Owner    | Encoding | Collation | Ctype |    Access privileges   

    -------------------+------------+----------+-----------+-------+-------------------------

    caldav            | caldav     | UTF8     | C         | C     |

    collab            | collab     | UTF8     | C         | C     |

    device_management | _devicemgr | UTF8     | C         | C     |

    postgres          | _postgres  | UTF8     | C         | C     |

    roundcubemail     | roundcube  | UTF8     | C         | C     |

    template0         | _postgres  | UTF8     | C         | C     | =c/_postgres           +

                       |            |          |           |       | _postgres=CTc/_postgres

    template1         | _postgres  | UTF8     | C         | C     | =c/_postgres           +

                       |            |          |           |       | _postgres=CTc/_postgres

    (7 rows)

     

    Warning: I haven't tried this, but doing something like this might reset only the Wiki:

    sudo -s

    serveradmin wiki stop

    /usr/bin/dropdb collab

    /System/Library/ServerSetup/CommonExtras/PostgreSQLExtras/CoreCollaborationPostgreSQLExtras.sh

    serveradmin wiki start