I just moved hosting providers for my Tracks instance, and exported YAML, and reimported it. Since YAML import isn't implemented, I had to do it by hand from a console. If this functionality is desired, here is some notes about how I did it:
Rails' autoloading was fun here, perhaps because i did this in a development environment console rather than a production console? Not sure. Either way, I had to require a bunch of model classes before the YAML would even parse correctly when loaded from disk.
Import order:
contexts
projects
tags
recurring todos
todos
taggings
For referential integrity purposes, the ordering is pretty important, since there's all sorts of ids in the yaml export. The order above allowed me to import everything keep everything linked properly.
When load in the YAML, you get actual objects. Calling save on them does nothing though, because ActiveRecord thinks they're not needing to be saved. I had to use create with the attributes with something like:
One of the reasons this was so successful is because i have a single user instances of tracks that isn't very busy. We'd have to make serious considerations for things like multiple users, different ids for model data, etc.
Feel free to close this after reading. I just wanted to share the information. :smiley:
I just moved hosting providers for my Tracks instance, and exported YAML, and reimported it. Since YAML import isn't implemented, I had to do it by hand from a console. If this functionality is desired, here is some notes about how I did it:
Rails' autoloading was fun here, perhaps because i did this in a development environment console rather than a production console? Not sure. Either way, I had to require a bunch of model classes before the YAML would even parse correctly when loaded from disk.
Import order:
For referential integrity purposes, the ordering is pretty important, since there's all sorts of ids in the yaml export. The order above allowed me to import everything keep everything linked properly.
When load in the YAML, you get actual objects. Calling
save
on them does nothing though, because ActiveRecord thinks they're not needing to be saved. I had to usecreate
with the attributes with something like:One of the reasons this was so successful is because i have a single user instances of tracks that isn't very busy. We'd have to make serious considerations for things like multiple users, different ids for model data, etc.
Feel free to close this after reading. I just wanted to share the information. :smiley: