3 Replies Latest reply: Apr 22, 2012 7:15 AM by Steven Bytnar
jmacalister Level 1 Level 1 (0 points)

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
  • jmacalister Level 1 Level 1 (0 points)

    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

     

     

  • Xavier Laville Level 1 Level 1 (10 points)

    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

  • Steven Bytnar Level 1 Level 1 (0 points)

    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