I have several (old) Drupal sites that need to be replaced with one new Rails application. This new site should contain all the old Drupal content. This old Drupal content is partially broken (due to almost 7 years of modernization, discontinued modules, etc.). The fact that this is Drupal is unlikely to matter, just the fact that it causes some inconsistencies, strange names, and poorly normalized tables.
The content you need to import into the Rails application is simple: content (blog posts), file attachments (images), and comments. I have the luxury of two databases that are "outdated" (not in production), and two more are in production, but allow you to go down / lock for a while (hours, days). Thus, migrations do not need to be optimized for speed or to be fully saved (which means: I can afford to lose the comment sent when the migration was performed).
The Rails (3) application is mainly executed and uses only Active-Record conventions.
Due to inconsistencies (incorrect database, several databases requiring merging), I prefer to write migrations for this, rather than connecting my new Rails application to an ugly, inconsistent legacy databse.
My questions:
- Are there any environments, gems, or tools that make importing into Rails easier: for example, which allows a simple mapping from old-new in some DSLs.
- Or is it easier to write my migrations completely in SQL: SQL queries that turn old data into a structure that is suitable for a Rails application? Migration comes from MySQL-> MySQL.
- Or I just need to connect Activerecord to old databases, iterate over each row / result and run Object.save! in my rails application?
source share