Brent,

The first thing I'd ask is, do both the old and new versions of the app 
have decent test coverage?  If so then you may have a decent safety net for 
doing the migration, sort of a "canary in the coal mine" setup.  If not, 
you've got your work cut out for you.  I can say this with confidence since 
I'm in the middle of upgrading my own Rails 2.3 app to Rails 3.2, with no 
test coverage on the old app.

As for the migration from Mongo to Postgres, the key bit here is are the 
models the same between the two versions?  If they're different, does the 
new version represent a somewhat simple expansion of the model attributes, 
or is it a complete rewrite of inter-model associations, moving 
functionality between new models, and adding and removing existing models?

Since Mongo is schema-less you'd have to take care in migrating data where 
validations have been added to the new version.  In other words, if fields 
are missing in the Mongo data that are now required or otherwise validated 
in the new model you'll have to handle that, perhaps with default "missing" 
values.  

Another thing to watch out for is a MongoDB that stores images or other 
binary data directly in the document.  That will present a challenge in 
migrating it to something more "Railsy" like PaperClip or Carrierwave.

There are probably some decent references on the web for doing a Mongo to 
Postgres migration since it seems to occur frequently.

Let me know what you're facing and I'll see if I can offer some more 
tailored advice.

Cheers,

Chris

On Sunday, March 16, 2014 9:30:48 AM UTC-7, Brent Payne wrote:
>
> I am inheriting a project where there are two ruby on rails 
> implementations of the same project.  The old running version and the new 
> feature complete version.  Both versions were written by different groups 
> of people.  The money wants to get the website off of the first version and 
> onto the second version of code. The first version is running on a Mongo 
> database and the second version on postgres.  This was a conscious 
> decision.  Now I'm a RnR n00b and the money is really a friend who is 
> paying me in good will and friendship. To me, this sounds like a hairy 
> situation and a a good puzzler.  What I want to know is how would a RnR 
> ninja handle this?  Migrations?
>
> Enjoy,
> Brent
>

-- 
-- 
SD Ruby mailing list
[email protected]
http://groups.google.com/group/sdruby
--- 
You received this message because you are subscribed to the Google Groups "SD 
Ruby" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to