Want to highlight a helpful answer? Upvote!

Did someone help you, or did an answer or User Tip resolve your issue? Upvote by selecting the upvote arrow. Your feedback helps others! Learn more about when to upvote >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How do I move or backup MacOS X 10.7 Lion Server wikis?

Hi,


I'm running OS X 10.7 Lion Server primarily for the Wiki server feature. I have a Mac Pro running 10.7 Lion Server and I can access the Mac Pro wiki from anywhere. The problem is the Mac Pro wiki is empty and I originally created a 10.7 Server Wiki on my MacBook Pro laptop. How do I backup and move the 10.7 Wiki from my laptop to my Mac Pro tower also on 10.7 Server? I've seen articles online about migrating Wiki from 10.5-10.6 to 10.7, but I've found nothing on the process of moving a 10.7 Lion Server wiki to another machine also running 10.7 Lion Server. How do I accomplish this?


Thank you!

Mac OS X (10.7), Mac OS X 10.7 Lion Server

Posted on Aug 6, 2011 9:50 AM

Reply
37 replies

Aug 11, 2011 11:38 AM in response to Eric Snyder

This is quite a bit more difficult than it was in the previous versions of OS X. If you haven’t changed much in it since the original conversion from Snow Leopard, it would be easier to use that data. However, I have figured out how to do it from Lion as well.



Browse in your Snow Leopardserver to /Library and copy the Collaboration directory.


Copy this to the desktop of your Lion server.


Now start the Wiki in the Server app of the Lion server.



Assuming eric is the user name you are logged in under:

Execute the folowing command:

sudo wikiadmin migrate -r /Users/eric/Desktop/Collaboration



If you want transfer the current wiki from Lion to Lion:


open terminal and type thefollowing lines:

sudo -s

PGUSER=_postgres pg_dumpall >cluster.dump



This will dump all of your databases into a file, called "cluster.dump"


You can find the file in yourhome directory.


Transfer this file to your new server into the home directory.



Download this zip file on your new server: http://sourceforge.net/projects/phppgadmin/files/phpPgAdmin%20%5Bstable%5D/phpPg Admin-5.0/phpPgAdmin-5.0.2.zip/download,unzip it, rename the folder to "phppgadmin"(this is to make it easier to browse to) and copy it into your /Library/Server/Web/Data/Sites/Default folder.



In your server app, go to the web service and check the box next to "Enable PHP web applications".



Open safari and browse to http://localhost/phppgadmin


Click on PostgreSQL and that will bring up a login screen.


Use the login name of _postgres.

The password is your administrator password.



You should see the following databases:

caldav

collab

device_management

postgres

roundcubemail



Go to the server app and turn all the services off except for the Web service (be sure that the wiki service is off as well)



In the phppgadmin screen, click on the PostgresSQL icon on on the left pane.



Check all the boxes next to the databases excluding the postgres database.



In the 'Action on multiple lines" section select "drop" then Execute



This will delete all the databases except for the "posgres" database. (don’t worry, all these databases are in the file you made and transferred to your home directory.



After you have verified that all the databases are gone except for the postgres one, run the following lines:

sudo -s

PGUSER=_postgres psql -f cluster.dump template1



This should rebuild the databases including all your data from the other server.


There is one more step: you need to copy the /Library/Server/Wiki/FileData folder from your old server to the new one. (this contains all the attachments files on your old wiki). You might have to repair permissions after that as well.



There may be some problems you encounter after this, as im not sure if there are any other data stores you need from your other server. KEY!! Backup before you try any of this! The best backup to use is a bootable image. Time Machine does NOT backup databases. I use SuperDuper from shirt pocket. If you use this program,make sure your external drive is partitioned using the GUID table and is bootable. Then backup “all files” using the Erase and Backup script. Be sure to test this backup, restart the server while holding down the option key. This should bring up a menu where you can select the backup drive and boot from it.Select the backup drive and hit return. If it boots up just fine, your backup is working!



Hope this helps.



Good Luck!

Dec 22, 2011 5:41 PM in response to almafromburley

I am having to restore wiki services from a time machine backup which I have recently found out it is not a viable solution for server service data. In order to run the terminal command you mentioned above that dumps everything into the cluster.dump file I had to restore from that time machine backup however it came back with the following error in terminal:


wiki:~ admini$ sudo -s PGUSER=_postgres pg_dumpall >cluster.dump

Password:

pg_dumpall: could not connect to database "template1": could not connect to server: No such file or directory

Is the server running locally and accepting

connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"?


Just so you know once I restored the machine from the lion time machine backup it doesn't even let me log into the server.app to change any settings and on a client machine when I attempt to go to the wiki in safari it just says "server error"


Ideally, I would like to migrate the wiki service data and files over manually from the 10.7 time machine backup and move it into a freshly installed 10.7 server machine. Is this possible?


Thanks for you help.

Jan 2, 2012 2:53 PM in response to j0nnyappleseed000

IF you restored from the time machine backup allready then the service data is no longer there. When Time Machine is enabled, it will automatically dump those databases in a file. The lile is located at /Library/Server/postgreSQL/backup. This file is named "dumpall.psql.gz". If you want to start with a fresh server install, you can just get the above mentioned file from the time machine hard drive and rebuild the databases on your new machine with that. In addition you will need the /Library/Server/Wiki/FileData folder. This folder contains any attachments or media you have uploaded to the wiki. However, when you copy the FileData folder to your new server, you will need to do it in a commandline environment and copy it without changing any permissions.

Jan 12, 2012 3:01 AM in response to Eric Snyder

The hole issue is a bad joke!!!

The worst OS Apple has ever created! Are there any third party apps that can handle the new features?

If one looks deeper inside, every thing seems to be hidden in ruby – and I'm not willing to learn a new programming laguage. In SL every entry was visible and moovable to other locations. In my opinion this is not serious server for sysadmins. ANY TOOLS AROUND that make wiki administration more handy?


Thanks for your help!

Mar 6, 2012 4:13 PM in response to delmod

After you have your server up and running from a fresh install, do the following:


unzip and tranfer the "dumpall.psql.gz" file to your home directory.


Download this zip file on your new server :http://sourceforge.net/projects/phppgadmin/files/phpPgAdmin%20%5Bstable%5D/phpPg Admin-5.0/phpPgAdmin-5.0.2.zip/download,unzip it, rename the folder to "phppgadmin"(this is to make it easier to browse to) and copy it into your /Library/Server/Web/Data/Sites/Default folder.



In your server app, go to the web service and check the box next to "Enable PHP web applications".



Open safari and browse to http://localhost/phppgadmin


Click on PostgreSQL and that will bring up a login screen.


Use the login name of _postgres.

The password is your administrator password.



You should see the following databases:

caldav

collab

device_management

postgres

roundcubemail



Go to the server app and turn all the services off except for the Web service (be sure that the wiki service is off as well)



In the phppgadmin screen, click on the PostgresSQL icon on on the left pane.



Check all the boxes next to the databases excluding the postgres database.



In the 'Action on multiple lines" section select "drop" then Execute



This will delete all the databases except for the "posgres" database. (don’t worry, all these databases are in the file you transferred to your home directory.



After you have verified that all the databases are gone except for the postgres one, run the following lines in terminal:

sudo -s

PGUSER=_postgres psql -f dumpall.psql template1



This should rebuild the databases including all your data from the other server


For transferring the wiki data files, im assuming that since you have a file named "dumpall.psql.gz" that you are restoring from a Time Machine Backup? If thats the case, with your external hard drive holding your time machine backup typr the following commands in terminal:


sudo -s


Here is the sytax for the copy command: I think you will need the -apvX switch.

cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file ... target_directory


So an example of this command would be :

cp -apvX /backupdrive/Library/Server/Wiki/FileData /Library/Server/Wiki/FileData


If that doesnt work here is a link to the sytax that will give some definitions for each switch.

https://developer.apple.com/library/mac/#documentation/Darwin/Reference/Manpages /man1/cp.1.html

Mar 7, 2012 11:37 AM in response to delmod

I'm not sure what would cause that to happen. You don't need the wiki service to be on to connect to the databases. The only service that should be running is the web service. You also have to make sure that the "Enable PHP web applications" is checked. The "collab" (if you haven't already figured out) is the wiki database. So you will definitely need to drop that one so it can be rebuilt. You might try a reboot if you haven't already.

Mar 12, 2012 6:50 PM in response to delmod

Hello !


Maybe someone else need this answer. The Terminal line to import the Wiki databse works only if ALL services are down and only the PostgreSQL service is up and running.


To backup the data in Terminal use :


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

sudo cp -R /Library/Server/Wiki/FileData $HOME/FileData


To restore the data in Terminal use :


sudo cp -R $HOME/FileData /Library/Server/Wiki/FileData

sudo chown -R _teamsserver:_teamsserver /Library/Server/Wiki/FileData

sudo chmod -R +a "www allow read" /Library/Server/Wiki/FileData

sudo serveradmin stop wiki

sudo serveradmin start postgres

sudo rake -f /usr/share/collabd/server/Rakefile db:drop

sudo createuser -U _postgres -d -s collab

sudo createdb -U collab collab

sudo -u _postgres pg_restore -d collab -U collab --single-transaction $HOME/collab.pgdump

sudo serveradmin start wiki


Attention, booth Lion Server machines must have the same version !


C. M.

Mar 14, 2012 2:37 AM in response to PleaseandThankYou

@PleaseandThankYou : Yes and no, depends on your setting. The steps I postet here are from a Apple Support document and I will point out why they do what they do,


1.) Tools like phppgadmin and pgAdmin 3 requires that PostgreSQL accepts TCP / IP connections to work - which are by default not allowed (security reasons).

2.) In newer versions of Lion the user _postgres is there but by default not allowed to use the account (security reasons) - so you can´t use sudo -s ... - instead of that you have to use the -u / -U option as above shown.

3.) If you don´t use the -c option (for drop DB) during dump the DB you cold run in troubles at restoring - specially if you write in a open DB (when the wiki server runs). Apple uses a script to delete the DB - so it was rebuilded from 0. You should never restore a DB if the service is running, maybe it works - the chance to get corrupted data is very big. I have tried this using the debug option of PostgreSQL.

4.) The --blobs option dumps also big objects in DB (only required if you dump a single DB and not all DB´s as above).


The daily backups of PostgreSQL are stored in /var/pgsql.

How do I move or backup MacOS X 10.7 Lion Server wikis?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.