# /admin/export

**URL:** <https://www.ruby-forum.com/t/admin-export/98468>\
**Category:** Radiant CMS\
**Created:** [July 14, 2006, 10:45pm UTC](https://www.ruby-forum.com/t/admin-export/98468 "2006-07-14T22:45:09Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![James\_MacAulay](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/4af34b/32.png) [@James\_MacAulay](https://www.ruby-forum.com/u/James_MacAulay)\
**Post date:** [July 14, 2006, 10:45pm UTC](https://www.ruby-forum.com/t/admin-export/98468/1 "2006-07-14T22:45:09Z")

</div>

Hi all,

I’m rather new to radiant and I’m using it to set up a small-scale  
intranet  
site. I wanted to do an /admin/export to create a template that could be  
used for the setup\_database script, but I’m running into difficulties.  
The  
YAML file I get from the export seems to be in a different format than  
setup\_database is expecting.

I’m not very familiar with YAML or how it is generated and parsed in  
Ruby,  
so I’m a bit lost. I was initially running Radiant from a RubyGem, but  
I’ve  
since switched to the subversion trunk in the hopes that this issue  
would be  
resolved (perhaps by the fact that it’s got its own Rails in  
/vendor/…I  
thought maybe this was an issue with my version of Rails and how it  
handles  
YAML conversions).

So I’ve got Radiant rev. 85 running on Rails 1.1.2 (or whichever version  
is  
in /vendor/), served via LightTPD.

Any help would be greatly appreciated.

-James MacAulay  
Ottawa, Canada

The export files I get look like this:

* * *

Snippets:  
5:  
name: firefox-reminder  
updated\_at: 2006-07-13 19:43:46 Z  
filter\_id: “”  
created\_by: 1  
updated\_by:  
id: 5  
content:   
created\_at: 2006-07-13 19:43:46 Z  
1:  
name: header  
updated\_at: 2006-07-13 15:58:42 Z  
filter\_id: Textile  
created\_by: 1  
updated\_by: 1  
id: 1

…etc.

The templates in /db/templates, on the other hand, look like this:

name: Simple Blog  
description: Setup Radiant as a simple weblog.  
records:  
Layouts:  
main:  
id: 1  
name: Normal  
content: |

…etc.

---

<div class="post-metadata">

**Author:** ![James\_MacAulay](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/4af34b/32.png) [@James\_MacAulay](https://www.ruby-forum.com/u/James_MacAulay)\
**Post date:** [July 15, 2006, 3:09am UTC](https://www.ruby-forum.com/t/admin-export/98468/2 "2006-07-15T03:09:41Z")

</div>

I put a small primer up here [http://www.ruby-forum.com/topic/68883](http://www.ruby-forum.com/topic/68883) so  
you don’t have to reinvent the wheel. From my experience, I actually  
found it much faster and cleaner to write it out by hand, instead of  
taking the dump from /admin/export, though your experience might be  
different. (Maybe we should make a more in depth explaination on making  
templates in the docs? I’ll start writing one up this weekend.)

---

<div class="post-metadata">

**Author:** ![James\_MacAulay](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/4af34b/32.png) [@James\_MacAulay](https://www.ruby-forum.com/u/James_MacAulay)\
**Post date:** [July 15, 2006, 4:17am UTC](https://www.ruby-forum.com/t/admin-export/98468/3 "2006-07-15T04:17:38Z")

</div>

Bernard Yu wrote:

> I put a small primer up here [http://www.ruby-forum.com/topic/68883](http://www.ruby-forum.com/topic/68883) so  
> you don’t have to reinvent the wheel. From my experience, I actually  
> found it much faster and cleaner to write it out by hand, instead of  
> taking the dump from /admin/export, though your experience might be  
> different.

Yeah YAML can be a bit difficult to format at times. It’s best to set  
your editor to use spaces (two per indent). I’d like to work on the  
export feature a little, though. It’s tripped more than a couple of  
people up.

> (Maybe we should make a more in depth explaination on making  
> templates in the docs? I’ll start writing one up this weekend.)

That would be good. Add it to the Radiant Handbook on the dev wiki.

–  
John L.  
[http://wiseheartdesign.com](http://wiseheartdesign.com)

---

<div class="post-metadata">

**Author:** ![James\_MacAulay](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/4af34b/32.png) [@James\_MacAulay](https://www.ruby-forum.com/u/James_MacAulay)\
**Post date:** [July 17, 2006, 6:19pm UTC](https://www.ruby-forum.com/t/admin-export/98468/4 "2006-07-17T18:19:26Z")

</div>

James MacAulay wrote:

> Thanks for the clarification. I see now that there was previous  
> discussion about this not too long ago (in the “Informal Competition”  
> thread), so my apologies for that bit of redundancy.
> 
> It looks like it would be pretty straightforward to write an export  
> script which makes setup\_database-friendly templates. I’d be  
> interested in tackling this myself, if other people think this would  
> be a good thing to do. Are there any major stumbling blocks I should  
> be aware of?

It should be fairly trival to update Radiant::Exporter to handle this:

[http://dev.radiantcms.org/radiant/browser/trunk/radiant/app/models/radiant/exporter.rb](http://dev.radiantcms.org/radiant/browser/trunk/radiant/app/models/radiant/exporter.rb)

Please consider creating a patch.

–  
John L.  
[http://wiseheartdesign.com](http://wiseheartdesign.com)

---

<div class="post-metadata">

**Author:** ![James\_MacAulay](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/4af34b/32.png) [@James\_MacAulay](https://www.ruby-forum.com/u/James_MacAulay)\
**Post date:** [July 17, 2006, 6:08pm UTC](https://www.ruby-forum.com/t/admin-export/98468/5 "2006-07-17T18:08:50Z")

</div>

Thanks for the clarification. I see now that there was previous  
discussion about this not too long ago (in the “Informal Competition”  
thread), so my apologies for that bit of redundancy.

It looks like it would be pretty straightforward to write an export  
script which makes setup\_database-friendly templates. I’d be  
interested in tackling this myself, if other people think this would  
be a good thing to do. Are there any major stumbling blocks I should  
be aware of?

James

---

<div class="post-metadata">

**Author:** ![James\_MacAulay](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/4af34b/32.png) [@James\_MacAulay](https://www.ruby-forum.com/u/James_MacAulay)\
**Post date:** [July 17, 2006, 7:03pm UTC](https://www.ruby-forum.com/t/admin-export/98468/6 "2006-07-17T19:03:14Z")

</div>

Right. Will do.

James
