Migrate Ajaxplorer props to Pydio (in share DB entries)

tags/0.2.0
Daniel Berteaud 11 years ago
parent 0c3950edb6
commit eb4db1e78b
  1. 4
      root/etc/cron.daily/pydio-indexer
  2. 15
      root/etc/e-smith/db/accounts/migrate/Ajaxplorer2Pydio

@ -21,8 +21,8 @@ foreach (0..32){
$id .= $chars[rand @chars]; $id .= $chars[rand @chars];
} }
foreach my $share ($a->get_all_by_prop(type => 'share')){ foreach my $share ($a->get_all_by_prop(type => 'share')){
$pydio = $share->prop('Ajaxplorer') || 'disabled'; $pydio = $share->prop('Pydio') || 'disabled';
$indexer = $share->prop('AjaxplorerIndexer') || 'enabled'; $indexer = $share->prop('PydioIndexer') || 'enabled';
next if ($pydio ne 'enabled' || $indexer ne 'enabled'); next if ($pydio ne 'enabled' || $indexer ne 'enabled');
my $name = $share->key; my $name = $share->key;
# Check if the lock file is present and if it's too old (last index crashed ?) # Check if the lock file is present and if it's too old (last index crashed ?)

@ -0,0 +1,15 @@
{
# Rename Ajaxplorer props to Pydio
foreach my $share ($DB->get_all_by_prop(type => 'share')){
my $ajaxplorer = $DB->get_prop_and_delete($share->key, 'Ajaxplorer');
next unless defined ($ajaxplorer);
$share->merge_props(
Pydio => $ajaxplorer
);
my $indexer = $DB->get_prop_and_delete($share->key, 'AjaxplorerIndexer');
next unless defined ($indexer);
$share->merge_props(
PydioIndexer => $indexer
);
}
}
Loading…
Cancel
Save