Migration to different storage backends

11 views
Skip to first unread message

Matt Nichols

unread,
Jun 11, 2010, 1:07:44 PM6/11/10
to ruote
Hi All,
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.

Thanks!

John Mettraux

unread,
Jun 12, 2010, 4:58:01 AM6/12/10
to openwfe...@googlegroups.com

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

John Mettraux

unread,
Jun 14, 2010, 8:56:10 PM6/14/10
to openwfe...@googlegroups.com

On Sat, Jun 12, 2010 at 05:58:01PM +0900, John Mettraux wrote:
>
> 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.
>
> 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)

Hello Matt,

it's "copy_to" :

http://github.com/jmettraux/ruote/commit/bba8cef498c78e96773d7e85c5c73c31f9212c42


Best regards,

Matthew Nichols

unread,
Jun 14, 2010, 10:05:19 PM6/14/10
to openwfe...@googlegroups.com
Excellent. Thanks for your help, John!

--
Matthew Nichols
Co-Founder, CTO
TagCow | Munio Memory Services, LLC.
http://www.tagcow.com

See my availability at http://www.google.com/calendar/hosted/tagcow.com/embed?src=mnichols%40tagcow.com&ctz=America/Denver


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

Matthew Nichols

unread,
Jun 22, 2010, 5:27:57 PM6/22/10
to openwfe...@googlegroups.com
I don't see a way to provide a username and password for the couch db storage. I've tried embedding it in the host (e.g. "username:password@host") param, but Rufus::Jig::Http doesn't seem to like that. Is not supported?

--
Matthew Nichols
Co-Founder, CTO
TagCow | Munio Memory Services, LLC.
http://www.tagcow.com

See my availability at http://www.google.com/calendar/hosted/tagcow.com/embed?src=mnichols%40tagcow.com&ctz=America/Denver


John Mettraux

unread,
Jun 22, 2010, 8:06:07 PM6/22/10
to openwfe...@googlegroups.com

On Tue, Jun 22, 2010 at 03:27:57PM -0600, Matthew Nichols wrote:
>
> I don't see a way to provide a username and password for the couch db
> storage. I've tried embedding it in the host (e.g. "username:password@host")
> param, but Rufus::Jig::Http doesn't seem to like that. Is not supported?

Ouch, sorry no authentication in rufus-jig for now. I've been lazy and using ip based authentication.

Give me some time to add it.

John Mettraux

unread,
Jun 27, 2010, 11:49:21 PM6/27/10
to openwfe...@googlegroups.com

Hello Matt,

I [hope to] have a fix for the "eats all my memory" issue you've encountered with migrations.

It's at

http://github.com/jmettraux/ruote/commit/48033de6f1ad87b3e9aad9ba1c6ec43be40011c2

Reply all
Reply to author
Forward
0 new messages