Previous 1 2 3 Next 37 Replies Latest reply: Sep 6, 2012 7:37 PM by VegetableZuchini
Eric Snyder Level 1 Level 1 (5 points)

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
  • almafromburley Level 1 Level 1 (5 points)

    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!

  • almafromburley Level 1 Level 1 (5 points)

    I was just thinking about this, it would be much easier and slic to copy the data from one server to the next with a bootable image. That would be my first recomendation. Then you can just run the hostserver name change wizard, to change the name and hostname of your new server to whatever you want.

  • j0nnyappleseed000 Level 1 Level 1 (0 points)

    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.

  • almafromburley Level 1 Level 1 (5 points)

    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.

  • logosound Level 1 Level 1 (0 points)

    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!

  • delmod Level 1 Level 1 (0 points)

    I have the "dumpall.psql.gz" file, and I want to start with a fresh server install. ¿How I rebuild the databases with it?. And please, how I copy de FileData folder without changing permissions?

     

    I'm really desperate. Never thought it was so difficult. I have a very big wiki.

  • almafromburley Level 1 Level 1 (5 points)

    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

  • CheezItMan Level 1 Level 1 (0 points)

    @Logosound

     

    Agreed, Lion is a disaster.  Hopefully quickly resolved with Mountain Lion.  Maybe a vista Windows 7 analogy here.

     

    The Apple Wiki for Lion is less than stable, as the search feature (a good idea, but bad execution) can quickly crash it with multiple people searching.  This is because it tries to search inside documents.

  • delmod Level 1 Level 1 (0 points)

    Thank you very much for your interest.

     

    I can't drop the "collab" database. The connection between phppgadmin and postgreSQL is only active if I have Wiki Server turned on. If I turn off Wiki Server then lost conection. If I tried to drop with Wiki Server turn on, I have an error.

     

    I need little help more. Thank you.

  • almafromburley Level 1 Level 1 (5 points)

    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.

  • delmod Level 1 Level 1 (0 points)

    Finally works. I need to turn off and on Web Service too. Your instructions worked except the terminal line to import File Data. It broke links. I restore directly the folder with TimeMachine and all OK.

     

    Almafromburley... I LOVE YOU

  • almafromburley Level 1 Level 1 (5 points)

    Im glad to hear you got it working.

  • Christoph Murauer Level 1 Level 1 (25 points)

    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.

  • PleaseandThankYou Level 1 Level 1 (25 points)

    Would not the ditto command be saficiant to duplicate your data from one location to the new?

Previous 1 2 3 Next