Moving a Daisy install from one computer to another
This document primarily addresses older versions of daisy. As of daisy release 1.5-M2, the need to have absolute paths in the myconfig.xml by was removed through the introduction property substitutions, such as ${daisy.datadir} and ${daisy.home}. The repository initialisation script now generates such myconfig.xml's without absolute paths. Therefore, with recent daisy versions you need to specify a datadirectory to the backup tool both for backup and for restore, this thus allows to restore to another data directory location straight away. (DSY-271)
I had deveIoped a DaisyWiki-site on my home computer and wanted to move it to
a publicly accesible server. I had planned to use the backup-tool but that
turned out to be not _so_ easy. Below is how I finally managed to copy the site
over to the server, with all data, styles, users etc. Very nice! I followed
a
procedure Bruno first lined out in a mail to the daisy-mailing-list and that
worked quite smoothly for me. The home computer (from now on called "origin") is
a Mac with OS X 10.4.5 and MySQL 4.1_18 installed, while the server (from now on
called "target") runs with Debian 2.6 and MySQL 4.1_10. I used DaisyWiki version
1.4.1.
"Your mileage may vary, but you know how to setup environments, right?". My
milage on the shell definitely varies. That's why the following might sound
quite verbose to the average sysadmin.
On the origin computer:
1) shutdown daisy
ps -ef
kill <daisy-wiki-process>
kill <daisy-repository-process>
<daisy-application-directory>/openjms/bin/shutdown.sh -u admin -p <look
password up in $DAISY_HOME/openjms/config/openjms.xml>
2) zip daisy-dir and daisydata-dir on the origin system
On the shell go into the directory which contains the daisy-wiki-directory
tar -czf daisyapp.tar.gz <daisy-application-directory>
On the shell go into the directory which contains the daisy-data-dircetory
tar -czf daisydata.tar.gz <daisy-data-directory>
To avoid any mistakes I copied the whole stuff. If bandwidth is an issue look into Bruno's mail for instructions.
3) make databse dumps
On the shell, enter:
mysqldump --opt -uroot -p<your-password> daisyrepository >
~/daisyrepodump.sql
mysqldump --opt -uroot -p<your-password> openjms >
~/daisyopenjmsdump.sql
See http://dev.mysql.com/doc/refman/4.1/en/mysqldump.html. The most interesting part is quite at the bottom, directly before the comments
4) copy compressed daisy and daisydata and database dumps to target
machine
No fancy command line instructions here. I use an SFTP-GUI-client. GUIs rule _so_ okay!
Now switch to the target computer.
On the target computer:
5) delete eventually existing database tables on the target
I did it this to make sure that my earlier attempts to move the wiki wouldn't cause any side-effects. If this is your first try omit this step. Anyway, I can't say anything particularly helpful here. I used mysql-admin to delete the two databases "openjms" and "daisyrepository".
6) uncompress daisyapp and daisydata to appropriate locations
Move the archives into the directories where you want them to get extracted
Enter these directories on the shell
tar -xzf daisyapp.tar.gz
tar -xzf daisydata.tar.gz
8) run database initialisation script
On the shell enter
mysql -uroot -p
Enter your password. Then, at the mysql-prompt, copy-paste the following:
CREATE DATABASE daisyrepository;
GRANT ALL ON daisyrepository.* TO daisy@'%' IDENTIFIED BY 'daisy';
GRANT ALL ON daisyrepository.* TO daisy@localhost IDENTIFIED BY 'daisy';
CREATE DATABASE openjms;
GRANT ALL ON openjms.* TO openjms@'%' IDENTIFIED BY 'openjms';
GRANT ALL ON openjms.* TO openjms@localhost IDENTIFIED BY 'openjms';
See daisy-installation-instructions for more details
9) restore databases
On the shell, go to the directory which contains the database dumps you
copied over from the origin. Enter:
mysql -uroot -p daisyrepository < daisyrepodump.sql
The shell will ask for your password
mysql -uroot -p openjms < daisyopenjmsdump.sql
The shell will ask for your password again
10) adjust some settings
Probably the file systems on the origin and on the target follow different
naming-conventions
You'll have to make some adjustments then.
Switch to the directory containing your DaisyWiki-data. Open
conf/myconfig.xml
Adjust all absolute paths there (blobstore, indexstore, jdbc driver location)
In my case there where three entries to adjust
line 11
<directory>/path/to/daisy-data-directory/blobstore</directory>
line 18
<indexDirectory>/path/to/daisy-data-directory/indexstore</indexDirectory>
line 82
<driverClasspath>/path/to/daisy-application-directory/lib/mysql/jars/mysql-connector-java-3.1.7-bin.jar</driverClasspath>
Switch to the directory containing your DaisyWiki-application. Open
openjms/config/openjms.xml
According to a mail from Bruno change database connection settings there
I found nothing and changed nothing either
Switch to the directory containing your DaisyWiki-application.
Open openjms/bin/setenv.sh
Change the location of the jdbc driver
line 13 CLASSPATH=
<path/to/daisy-application-directory>/lib/mysql/jars/mysql-connector-java-3.1.7-bin.jar
11) don't forget to set JAVA_HOME, DAISY_HOME and OPENJMS_HOME
12) start OpenJMS, DaisyRepository and DaisyWiki
# That's it.



There are no comments.