Skip navigation

Move WIKI data from one Mountain Lion Server to another

3988 Views 12 Replies Latest reply: Jan 5, 2014 9:51 AM by FlorianLeo RSS
Matthew Jason Level 1 Level 1 (0 points)
Currently Being Moderated
Dec 17, 2012 9:01 PM

Hi.

 

I followed the instruction here:

 

http://support.apple.com/kb/HT5585

 

Under Copying all wikis from one OS X server to another OS X server, I am not even able to execute:

 

sudo pg_dump --format=c --compress=9 --blobs --username=collab --file=/tmp/collab.pgdump collab

 

It gives this error:

 

pg_dump: [archiver (db)] connection to database "collab" failed: FATAL:  role "collab" does not exist

 

Any idea?

 

I just tested it on the productive server as well as a brand new install. Same outcome.

 

which then I moved the: /Library/Server/Wiki/FileData over but even stop/start, restart, wiki server is running but not able to load content, it's like it's been wiped clean.

 

matthew

MacBook Air (13-inch Late 2010), OS X Mountain Lion (10.8.2)
  • Rolf Kocherhans Calculating status...

    I can confirm this, I have exactly the same problem !

     

    Unfortunatly I have no solution !!!!

  • Rolf Kocherhans Level 1 Level 1 (5 points)

    Do you remeber the OSX and Server version ?

     

    Cheers

    Rolf

  • Rolf Kocherhans Level 1 Level 1 (5 points)

    Hello Jason

     

    I would LOVE to provide a better suggestion, but I can't. Like you, I am

    searching for days for a solution, tried many things including adding

    the path to .profile etc. !!!

     

    Nothing worked !

     

    A colleague suggested to try to use a Time Machine backup from an old server

    and on the new use the Migration Assistant to import the WIKI !

     

    This is NOT what I wanted to do, but right now I am trying this, just to see

    if it works !

     

    My goal would be to export a WIKI and then setup a new fresh clean OS X Server and

    import the old WIKI Data. This, to have a clean start !

     

    The old Server was updated/migrated from 10.6.8 and I don't trust it,

    also I need a worst case senario.

     

    If I find out something I will post it asap !

     

    Cheers

    Rolf

  • Doug Whitmore Level 2 Level 2 (235 points)

    For Server 2.2 you need to add another flag to pg_dump and pg_restore:

    -h "/Library/Server/PostgreSQL For Server Services/Socket"

     

    So, for dump on a 2.2 Server:

    sudo pg_dump -h "/Library/Server/PostgreSQL For Server Services/Socket" --format=c --compress=9 --blobs --username=collab --file=/tmp/collab.pgdump collab

     

    And for restore:

    sudo -u _postgres pg_restore -h "/Library/Server/PostgreSQL For Server Services/Socket" -d collab -U collab --single-transaction /tmp/collab.pgdump

  • Rolf Kocherhans Level 1 Level 1 (5 points)

    Hello Metthew

     

    I got some mor infos from an Apple System Engineer, with it, I could successfully export the WIKI .

     

    1. Frist install Workgroup Manager and add your Admin account to the postgress group !

    2. Paste this into Terminal:

     

    sudo /Applications/Server.app/Contents/ServerRoot/usr/bin/pg_dump  -h /Library/Server/PostgreSQL\ For\ Server\ Services/Socket --format=c --compress=9 --blobs --username=collab --file=/tmp/collab.pgdump collab

     

    You will notice that the script is similar to Dougs but it uses the pg_dump inside the Server app.

     

    This worked for me ----- finally

     

    I then copied the exorted /tmp/collab.pgdump to the new Server and I am now trying to import this

    with help of http://support.apple.com/kb/HT5585 but I strugle - give me some more time to try.

     

    Cheers

    Rolf

  • Rolf Kocherhans Level 1 Level 1 (5 points)

    Hello Metthew

     

    Apple has change the information (Terminal commands) on its KB Article

    http://support.apple.com/kb/HT5585 on december 21 !

     

    I have just tried the new commands, and can report that moving WIKI data from

    10.8.2 to a new 10.8.2 does now work !

     

    Cheers

    Rolf

  • Bolla_ Calculating status...

    I have a solution to recover the Wiki after OSX 10.8 was restored from a TimeMachine Backup.

     

    1. get the Backup file in /Library/Server/PostgreSQL For Server Services/Backup/dumpall.psql.gz
    2. extract the file to /tmp/dumpall.psql or to an other directory
    3. Follow the instructions in http://support.apple.com/kb/HT5585 like this:
      • sudo chown -R _teamsserver:_teamsserver /Library/Server/Wiki/FileData
      • sudo chmod -R +a "www allow search" /Library/Server/Wiki/FileData

      • sudo serveradmin stop wiki

      • sudo serveradmin start postgres_server

      • cd /Applications/Server.app/Contents/ServerRoot/usr/bin/

      • sudo ./dropdb -h "/Library/Server/PostgreSQL For Server Services/Socket" -U collab collab

      • sudo ./createdb -h "/Library/Server/PostgreSQL For Server Services/Socket" -U collab collab

    4. Then use "psql" instead of "pg_restore":
      • sudo psql -U _postgres -d collab  -h "/Library/Server/PostgreSQL For Server Services/socket" -f /tmp/dumpall.psql
    5. Start the Wiki Server
      • sudo serveradmin start wiki
    6. Done!

     

    Greets

     

    Bolla

  • FlorianLeo Level 1 Level 1 (0 points)

    try it and RATE correct answers

     

     

     

     

    Hello Matthew

     

     

    You're looking in the wrong spot

    First things first - make yourself default sudo with sudo -s then you can forget prefixing it all the time.

     

     

    • If you just use pg_dump then it'll take the command from the /var-Directory - that's the wrong version
    • You have to specify the path for the Socket where the PSQL-Database for the wiki really is located by using the -h-option - it's not the default

    that's why you get the error that role collab does not exist since you're connecting to a database in place where the role collab truy isn't part of it.

     

     

    So - if you'd like to export the wiki-DB us the following and adapt the filename to what you like it to be.

     

     

    bash-3.2# /Applications/Server.app/Contents/ServerRoot/usr/bin/pg_dump -h "/Library/Server/PostgreSQL For Server Services/Socket/" -p 5432 -f /Volumes/USBSTICK/wikidatabase.pgdump -U collab collab

     

     

    • The first block specifies the "not default" pg_dump you'd like to use
    • The second block (-h "/Library/.....) tells pg_dump where to find the DB
    • The third block tells pg_dump to use port 5432
    • The fourth block (-f /Volumes/......) tells pg_dump to place its output into this file
    • The fifth block (-U collab) tells pg_dump to do this is role collab
    • The sixth block tells pg_dump from with DB to dump from

     

     

    In your case extend my provided command with your options --format=c --compress=9 --blobs like this:

    bash-3.2# /Applications/Server.app/Contents/ServerRoot/usr/bin/pg_dump -h "/Library/Server/PostgreSQL For Server Services/Socket/" -p 5432 -F c --compress=9 -b -f /Volumes/USBSTICK/wikidatabase.pgdump -U collab collab

     

     

     

     

     

    BTW- you can connect to the database, of course:

    bash-3.2# psql -h "/Library/Server/PostgreSQL For Server Services/Socket/" -p 5432 collab collab

     

     

     

    try it and RATE correct answers

     

     

    Here is my thread https://discussions.apple.com/thread/5751873

Actions

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

  • This solved my question - 10 points
  • This helped me - 5 points
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the Apple Support Communities Terms of Use.