implementing replication logic

also fixed bug in export of groupless repo