On Fri, Jun 11, 2010 at 10:07:44AM -0700, Matt Nichols wrote:
>
> I am looking for an example that shows how to move existing processes
> from one storage backend to another (e.g. from fs_storage to
> couch_storage). I know I've seen something before, but I haven't been
> able to find it.

Hello Matt,

sorry for the late reply, I was on the road.

This script (http://gist.github.com/435577) should work for you :

---8<---
require 'rubygems'
require 'ruote'
require 'ruote/storage/fs_storage'
require 'ruote/couch'

source = Ruote::FsStorage.new(
  'ruote_work')

destination = Ruote::Couch::CouchStorage.new(
  '127.0.0.1', 5984, 'couch_prefix' => 'test')

%w[
  configurations errors expressions msgs schedules variables workitems
].each do |type|

  source.get_many(type).each { |item| destination.put(item) }
end
--->8---

Provided that you adapt the storages configuration to your situation.

I will add to ruote 2.1.10 a migrate_to or a copy_to storage methods to turn 
the last 6 lines of this script into something like

  source.copy_to(target)

Please note that ruote-couch 2.1.10 will be a bit better than the current 2.1.9.


Thanks for your patience,

-- 
John Mettraux - http://jmettraux.wordpress.com

-- 
you received this message because you are subscribed to the "ruote users" group.
to post : send email to [email protected]
to unsubscribe : send email to [email protected]
more options : http://groups.google.com/group/openwferu-users?hl=en

Reply via email to