Skip to content
flack edited this page Feb 8, 2015 · 1 revision

Repligard is a command-line utility for replicating content between databases. Repligard was used for Staging/Live setups, for backups and for installing new applications (almost all of them were shipped as gzipped Repligard xml packages).

Version 1.8. stills uses Repligard for installing legacy applications, but it is considered deprecated. Its role in the Staging/Live process was taken by Exorcist in Midgard 1.7.x. Repligard doesn't work for Multilang enabled installations, which is the default


Basically, the following four command-line options are used most of the time:

-i filename import data from a repligard package

-e filename export data from a database into a repligard package (which is a gzipped XML file)

-a export or import all content (instead of last modified)

-c configfile specifies the location of the config file to be used.

Common Problems

Please also note that for a successfull replication, the application must be Repligard-safe, which is to say it should not rely on Object IDs, but use GUIDs instead

  • the most common problem with Repligard is the error message "repligard-CRITICAL **: Error in DB connection". It usually means that the username or password in the config file are not correct.
  • the command <nowiki><replicate all ="yes"/></nowiki> is commented out in the standard version of this file and has to be enabled beofre any replicate commands can be effective


Enabling Staging/Live requires a working installation of the Midgard Framework, Aegir and two scripts from the YAMP package. To convert existing sites to Staging/Live, you'll also need Aegir's Tools AddOn.


Configuration is not exactly straightforward, as the main documentation is outdated. The main difference is that for Content Approvals to be respected, you need to install two scripts from YAMP, namely

Please note that there are three different variants of remove_unapproved, the standard one, one with sitegroup support and one with sitegroup and multilang support.

These new scripts require modifications to /var/lib/aegir/bin/ Here's a version that is known to work on a SuSE 9.0 system. To make it work on a Debian 3.0 system, just uncomment the lines regarding the character set conversion (the line starting with iconv and the one below.)


 #script to transfer data from staging database to live database.
 if [ -e /usr/bin/repligard ] ; then
 #0. fudge the page updates based on approval status

 PERL=`which perl`

 #${PERL} /var/lib/aegir/bin/

 #1. dump the changes to a file
 THISDATE=`/bin/date  %Y%m%d%H%M`

 $REPLIGARD -c /var/lib/aegir/etc/repligard_hourly_dump_staging.conf -e /tmp/hourly_export_${THISDATE}.xml.gz

 gunzip /tmp/hourly_export_${THISDATE}.xml.gz

 ${PERL} /var/lib/aegir/bin/ /tmp/hourly_export_${THISDATE}.xml

 ${PERL} /var/lib/aegir/bin/ /var/lib/aegir/etc/repligard_hourly_dump_staging.conf /tmp/hourly_export_${THISDATE}.xml

 #2. import the data into the live server

 #iconv -f UTF-8 -t ISO_8859-1 /tmp/hourly_export_${THISDATE} -o /tmp/hourly_export_${THISDATE}_conv.xml
 #$REPLIGARD -c /var/lib/aegir/etc/repligard_hourly_import_live.conf -i /tmp/hourly_export_${THISDATE}_conv.xml
 $REPLIGARD -c /var/lib/aegir/etc/repligard_hourly_import_live.conf -i /tmp/hourly_export_${THISDATE}

 #3. delete the file!

 rm /tmp/hourly_export_${THISDATE}.xml
 rm /tmp/hourly_export_${THISDATE}_conv.xml</code>


Category:Midgard Category:Deprecated