I have an existing Drupal site (php / mysql) that we’re planning to migrate to a javascript / node app over the next year. The idea is to migrate parts of the site independently over time until we’re completely off of php/mysql.
Is it feasible that when certain data is saved on our current site, to also push / save that data to Fauna so that we can later read that data from Fauna? If so, how would we approach that?
Along those same lines, we want to make this transition as seamless for our users as possible. How might we go about migrating user accounts (specifically passwords) to avoid forcing all of our users to reset their passwords?
Yes this is feasible. How to approach that is a very generic question though. I’m unable to answer more than that you would write the data at the same time you write the data to MySQL, first MySQL, then Fauna. You will of course have to deal with the possibility that a transaction fails. You could also try working with database triggers to update Fauna. Or you could start periodically taking a changeset from MySQL and start feeding that into Fauna (probably the safest choice since it’s probably easier to retry if a transaction fails due to some connection error (or code error) while in the former cases you are tying in such retry logic in your application logic)
Your passwords are probably encrypted in MySQL. If possible you’ll have to decrypt them and store them again in Fauna as a ‘credentials: { password: …}}’ field which is automatically encrypted and never returned. If that’s not possible (and that could be for very good reasons, in an ideal world, a developer should in theory not see/handle unencrypted passwords) then I don’t immediately see a way without forcing all users to reset their passwords.