On 11 Jun 2008, at 16:59, Simon Rozet wrote:

> Woops, forget to "reply to all"... sorry Reinier

>
>> Importing is still on the todo list and is being looked at,
>> but that does not help you now. I think you are right in that
>> some sort of banner and editing the text about moving between
>> installation, can help prevent people from getting in
>> your situation.
>
> I juts spotted yaml_db [1] on github which may help.
>
> [1]: http://github.com/adamwiggins/yaml_db/tree/master

Oliver, so sorry about this. It's all my fault really, because I tried  
to implement importing but didn't manage to get anything working well.  
We had already renamed the import/export page to just 'Export', but we  
forgot to remove the text on the page.

Anyway, I've downloaded the plugin Simon pointed to, and it works very  
well (at least with SQLite3, which is what I've tested with). However,  
your problem, if I understand it correctly, is that you don't have the  
original database, but only the YAML dump file, created through our  
export page.

The format for the yaml_db plugin is a bit different from our format.  
So, for the todos table, with a few contents, we have:

---
todos:
   columns:
   - id
   - context_id
   - project_id
   - description
   - notes
   - created_at
   - due
   - completed_at
   - user_id
   - show_from
   - state
   records:
   - - "1"
     - "1"
     - "2"
     - Call Bill Gates to find out how much he makes per day
     -
     - 2006-06-03 14:36:02
     - "2006-06-24"
     -
     - "1"
     -
     - active
   - - "2"
     - "2"
     - "3"
     - Call dinosaur exterminator
     - Ask him if I need to hire a skip for the corpses.
     - 2006-06-10 14:36:02
     - "2006-06-24"
     -
     - "1"
     -
     - active
   - - "3"
     - "4"
     -
     - Buy milk
     -
     - 2006-06-10 14:36:02
     -
     -
     - "1"
     -
     - completed
   - - "4"
     - "4"
     -
     - Buy bread
     -
     - 2006-06-10 14:36:02
     -
     -
     - "1"
     -
     - completed


So we list the column names first, then the records, with the fields  
in the same order. Each record is prefixed with two hyphens with a  
space between them, and each field in that record with a single  
hyphen. Each table is prefixed with a line containing just 3 hyphens.  
I don't think it's impossible that we could (with some text munging)  
convert one form to the other. Then in theory, you could just set up a  
new SQLite3 db in config/database.yml, then run rake db:load.

If I get some time, I'll see what I can do. In future, I think it  
would be great to create a YAML dump using this plugin, so people  
would have an easy import/export process, even if the import had to be  
done at the commandline rather than through the web UI.

cheers,
bsag

-- 
but she's a girl - the weblog of a female geek
http://www.rousette.org.uk
[EMAIL PROTECTED]

_______________________________________________
Tracks-discuss mailing list
[email protected]
http://lists.rousette.org.uk/mailman/listinfo/tracks-discuss

Reply via email to