Back to
UkActiveToMir Back to
UkMovingToMir Back to
ImcUkTech Back to
ImcUk
For more detail on various elements, refer to the "Long" install document located here:
http://mir.indymedia.org/en/2002/10/217.shtml
Here some instructions on how to migrate an imc from Stallman/Active to a new MIR server. This builds on an initial text by
SdLotus but is still incomplete. In the examples of the commands and paths below I use some words between square brackets that are different for different imc's and should be changed: "[yourimc]" is the login and imc name on Stallman/Active, and "[yourimclogin]" relates to the login and possibly your imc name on the MIR server.
Download and install MIR on a server
A good method to use is to create a mir user, and then create your site specific dir in /home/mir. So, for example, I use
/home/mir/sandiego
and in that directory, check out the mir code. That will make is easier to add other mir installs in the future. Instructions for doing so are here:
http://mir.indymedia.org/en/2001/08/8.shtml
You'll also need to install postgresql, tomcat 4, ant, JAI and apache. Better instructions for installing that software is here (but see below for Debian-specific details):
http://mir.indymedia.org/cvs/viewcvs.cgi/mir/doc/INSTALL.mir?rev=HEAD&content-type=text/vnd.viewcvs-markup
Debian specific things
Mir 1.1 has some prerequisites:
- postgres 7.1+
- tomcat 3 or > 4.0.3
- apache 1.3.x with mod_jk.so
- ant 1.4+
- jaxp, part of ant
- jai (java advanced imaging)
fortunately, when one uses Debian "woody" the debian packages can take care of most of these:
- apt-get install postgres gives you postgres 7.2
- apt-get install tomcat4 for tomcat
- apt-get install apache
- apt-get install libapache-mod-jk
- apt-get install ant
You'll also need a JDK; add the following line to your /etc/apt.sources.list file
deb ftp://ftp.easynet.be/blackdown/debian woody main non-free
then do
- apt-get update
- apt-get install j2sdk1.3
you'll be prompted to say "yes" to the license agreements
Tomcat items
you'll need to set and export the following environment variables:
TOMCAT_HOME=/usr/share/tomcat4
export TOMCAT_HOME
JAVA_HOME=/usr/lib/j2se/1.3
export JAVA_HOME
you'll need to install the JAI; wget works:
wget "http://dev11.mir.dnsalias.net/newjai/..."
and get four files:
- jai_codec.jar
- jai_core.jar
- libmlib_jai.so
- mlibwrapper_jai.jar
and these go into the $TOMCAT_HOME/common/lib directory
edit the following file /etc/default/tomcat4 as such:
TOMCAT4_SECURITY="no"
TOMCAT4_USER="www-data"
Postgres
employ the following steps:
su - postgres
psql template1
psql> alter user postgres with password 'some-postgres-password';
psql> \q
edit the /etc/postgresql/pg_hba.conf file:
local all password
host all 127.0.0.1 255.0.0.0 password
then:
/etc/init.d/postgresql restart
Then Mir can be checked out from cvs
cd to the directory you want to place the Mir code, then do the following two steps:
(CVS LOGIN)
cvs -d :pserver:anonymous@mir.indymedia.org:/var/lib/cvs login
- password
- anonymous
Note: the cvs has been moved to codecoop. use this now:
cvs -d :pserver:anonymous@cvs.codecoop.org:/cvsroot/mir login
(CVS CHECKOUT)
old:
cvs -d :pserver:anonymous@mir.indymedia.org:/var/lib/cvs co -r MIR_1_1 mir
as above, use this instead:
cvs -d :pserver:anonymous@cvs.codecoop.org:/cvsroot/mir co -r MIR_1_1 mir
you'll need to create the database for your site - if this is a new installation, there is a script in mir/dbscripts:
createmirdb.sh db_name postgres_superuser mir_db_username mir_db_users_password
at this point you edit the mir/etc/config.properties file to match your site's needs; cd to the mir directory, and run
ant
--
StefaniB - 11 Nov 2003
Make database dumps on Stallman/Active
You need to know the passwords for your imc's features and newswire databases. If you don't know them, ask on the #tech irc channel.
On Stallman/Active you'll be logged in with the generic logon of [yourimc]. I assume you're in your home directory. To dump both your features and newswire use the following commands:
mysqldump -v -u root -p imc | gzip -f -9 > features.sql.gz
enter password when prompted
pg_dump -v -u -d -h inglis -p 6543 --no-owner active_[yourimc] | gzip -f -9 > active.sql.gz
enter dbuser [yourimc] when prompted
enter password when prompted
added note by sb: one can use --opt switch with mysqldump e.g
mysqldump -v -u root -p --opt imc | gzip -f -9 > features.sql.gz
enter password when prompted
--opt turns on -quick, --add-drop-table, --add-locks, --extended-insert and --lock-tables
This should give fastest possible dump of database and locks the table while dump takes place.
mysqldump gives portable ASCII format unlike mysqlhotcopy which should not be used.
Note, if you are using postgres earlier than 7.3, such as is the case with Stallman, you need to include the option --inserts with your pg_dump.
Push the dumps to your MIR server
Now scp your features and newswire dumps over from Stallman/Active to your new server. Assuming you have created a directory "dumps" in your home directory on the MIR server, and your server's address being "mymirserver.domainname.org", you would use these commands:
scp features.sql.gz [yourimclogin]@mymirserver.domainname.org:~[yourimclogin]/dump/features.sql.gz
enter password when prompted
scp active.sql.gz [yourimclogin]@mymirserver.domainname.org:~[yourimclogin]/dump/active.sql.gz
enter password when prompted
Then gunzip the dumps on your MIR server. They should now both be in
/home/[yourimclogin]/dump/
Copy uploaded files from stallman (active)
Files uploaded to Stallman/Active are filed in just one directory per imc, in
/www/uploads/[yourimc]/
In here are the doc, htm, html, pdf, mov, wav and zip files. In the same directory there is as well another important directory where the other formats live:
/www/uploads/[yourimc]/metafiles/
In here are the gif, jp(e)g, png, mp(e)g, mp3, mov, ra, rm and wav files.
You will encounter a few weird files in possibly both directories that have nearly identical names like
-rw------- 1 apache apache 0 May 2 2002 01inbOOaUga
-rw-r--r-- 1 root root 36 Mar 15 2003 01inbooauga.mov
The file '01inbooauga.mov' is a placeholder that contains the path to the real file on Paranode (images.indymedia.org) - in this case that would be the url http://images.indymedia.org/imc/seattle/01inbooauga.mov ; for more details on the workings of this check
http://docs.indymedia.org/view/Sysadmin/StallmanDiskSpaceIssues .
You will not be able to import a placeholder like '01inbooauga.mov' with the MIR conversion scripts - you will have to get the original file from Paranode in order to import it into MIR.
On your MIR server dump the files into two directories - you need one for text and htm(l) files, and another for the other media. For the example commands to work below let's say these directories are
/home/[yourimclogin]/dump/textfiles/
/home/[yourimclogin]/dump/media/
There are a series of scripts that you can use to migrate from Active to Mir. They can be found here:
http://mir.indymedia.org/cvs/viewcvs.cgi/active2mir/
For instructions on how to access cvs and download these scripts and download them, see
http://mir.indymedia.org/en/2001/08/8.shtml
Let's say you have all these files in this directory:
/home/[yourimclogin]/active2mirscripts
The settings.sh file
First of all rename settings.sh-dist to settings.sh ; then you'll need to edit it to settings that are appropriate for your server. Below are only the examples of the database, the database dumps, and the text and media dump locations listed as they're described in this text - but you'll need to change a few more settings. If you get stuck ask about them on irc.indymedia.org in #mir.
For the database itself change lines 7 and 8 ("# connection details for the
new database:") to
DATABASE="[yourimclogin]"
DB_HOST="localhost"
For the database dump change lines 11 and 12 ("# locations for the dump files:") to
FEATURES_DUMP_FILE="/home/[yourimclogin]/dump/features.sql"
ACTIVE_DUMP_FILE="/home/[yourimclogin]/dump/active.sql"
For the text and media dumps change lines 35 and 36 ("# locations of the externally stored active data:") to
TEXT_SOURCE_PATH="/home/[yourimclogin]/dump/textfiles/"
MEDIA_SOURCE_PATH="/home/[yourimclogin]/dump/media/"
Importing your active IMC into your MIR server
Let's say you have created your database already with user [yourimclogin] and password [password].
Move into the directory where you put the conversion scripts (in our example /home/[yourimclogin]/active2mirscripts).
The best thing to start with is probably to look at automagic.sh and manually do the steps in that script one at a time. If you do the steps one at a time you can stop and catch any errors.
Once you've made sure that most errors are caught you could run the automagic script as a whole:
export PGUSER=[yourimclogin]
export PGPASSWORD=[password]
./automagic.sh > logfile
Check the logfile for any missing media or text files at
/home/[yourimclogin]/active2mirscripts/logfile
Carefully document any error you get and email them to
mir-coders@lists.indymedia.org or ask about them on irc.indymedia.org in #mir.
Caveats, Gotchas, Etc
You'll want to setup port forwarding so that your publish link correctly goes to the tomcat4 port.
You'll have to add a rewrite rule or redirect php script so that your old php links get rewritten into their new mir format.
Old stories show up in the admin console under their own category, as old stuff. You'll have to edit the templates in /etc/producer/templates to include those types.
At SD, when importing our old data we somehow ended up with ascii instead of unicode tables, watch out for that as its a pain in the ass to fix later.
Topic pages are not generated automatically because they take so long to generate. You'll have to add a cron job for them.
Good luck! Happy media making to you!
Used the initial text by
SdLotus that was on
UkActiveToMir and extended --
AndiE - 07 and 08 Nov 2003
Added a few brief sentences and links about how to install mir. Replaced the gaping hole with a totally inadequate crumb. --
SdLotus - 09 Nov 2003
updated cvs source - was mir.indy, now is codecoop --
StefaniB - 24 Feb 2005