# How to move from Trunk to Mental

**URL:** <https://www.ruby-forum.com/t/how-to-move-from-trunk-to-mental/82284>\
**Category:** Radiant CMS\
**Created:** [January 18, 2007, 7:24pm UTC](https://www.ruby-forum.com/t/how-to-move-from-trunk-to-mental/82284 "2007-01-18T19:24:39Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![BJ\_Clark](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bc79bd/32.png) [@BJ\_Clark](https://www.ruby-forum.com/u/BJ_Clark)\
**Post date:** [January 18, 2007, 7:24pm UTC](https://www.ruby-forum.com/t/how-to-move-from-trunk-to-mental/82284/1 "2007-01-18T19:24:39Z")

</div>

Hello List,  
I’ve currently got my site about 95% done using regular Trunk, but I’d  
like to move to mental since I can’t seem to get the mailer behavior  
working with the current trunk on my host.

Is there an easy way to do this without losing the content I currently  
have? I’ve been looking all over the [radiantcms.org](http://radiantcms.org) site and can’t  
find reference on how to upgrade anywhere.

Thanks,  
BJ Clark

---

<div class="post-metadata">

**Author:** ![BJ\_Clark](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bc79bd/32.png) [@BJ\_Clark](https://www.ruby-forum.com/u/BJ_Clark)\
**Post date:** [January 18, 2007, 7:38pm UTC](https://www.ruby-forum.com/t/how-to-move-from-trunk-to-mental/82284/2 "2007-01-18T19:38:21Z")

</div>

P.P.S. I’ll be in #radiantcms this afternoon if you want real-time help.

---

<div class="post-metadata">

**Author:** ![BJ\_Clark](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bc79bd/32.png) [@BJ\_Clark](https://www.ruby-forum.com/u/BJ_Clark)\
**Post date:** [January 18, 2007, 7:37pm UTC](https://www.ruby-forum.com/t/how-to-move-from-trunk-to-mental/82284/3 "2007-01-18T19:37:21Z")

</div>

Here’s a quick way to do it.

Depending on how you put the code on your server (via svn or tarball or  
gem), use SVN to checkout or export the code from the mental branch into  
the  
same directory.

In the root of the app (above public/), run rake db:migrate. This will  
bring your new installation inline with the latest database schema.

Now, restart your webserver/app server/fcgi processes and enjoy!

Sean

P.S. to install the Mailer extension, use SVN again, but checkout/export  
into the vendor/extensions directory instead of the root.

---

<div class="post-metadata">

**Author:** ![BJ\_Clark](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bc79bd/32.png) [@BJ\_Clark](https://www.ruby-forum.com/u/BJ_Clark)\
**Post date:** [January 19, 2007, 10:34pm UTC](https://www.ruby-forum.com/t/how-to-move-from-trunk-to-mental/82284/4 "2007-01-19T22:34:11Z")

</div>

List,  
The only issue I had upgrading (after removing all my page behavior  
types from the database by hand because all the behaviors were  
breaking everyhting) is that most of the links in admin don’t work  
anymore. I keep my site under /content/ and lots of the links are  
trying to load /admin/page instead of /content/admin/page.  
Is there some way to change this?

Thanks,  
BJ Clark

---

<div class="post-metadata">

**Author:** ![BJ\_Clark](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bc79bd/32.png) [@BJ\_Clark](https://www.ruby-forum.com/u/BJ_Clark)\
**Post date:** [January 20, 2007, 4:06am UTC](https://www.ruby-forum.com/t/how-to-move-from-trunk-to-mental/82284/5 "2007-01-20T04:06:46Z")

</div>

I’ve added that, but the tabs are still not working. All the other  
links are full links, the tabs are all at “/admin/layouts/” or  
whatever.  
Any suggestions?  
BJ Clark

---

<div class="post-metadata">

**Author:** ![BJ\_Clark](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bc79bd/32.png) [@BJ\_Clark](https://www.ruby-forum.com/u/BJ_Clark)\
**Post date:** [January 19, 2007, 10:39pm UTC](https://www.ruby-forum.com/t/how-to-move-from-trunk-to-mental/82284/6 "2007-01-19T22:39:11Z")

</div>

BJ,

Go into the config/environment.rb file and put this line at the bottom:

ActionController::AbstractRequest.relative\_url\_root = “/content”

Sean

---

<div class="post-metadata">

**Author:** ![BJ\_Clark](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bc79bd/32.png) [@BJ\_Clark](https://www.ruby-forum.com/u/BJ_Clark)\
**Post date:** [January 20, 2007, 11:59pm UTC](https://www.ruby-forum.com/t/how-to-move-from-trunk-to-mental/82284/7 "2007-01-20T23:59:44Z")

</div>

List,  
I’m still having this problem.  
In fact, I’m trying to get Sean’s Mailer Extension to work and it is  
redirecting to /contact/ instead of /content/contact/.

I have the suggested line in config/environment.rb, but it doesn’t  
seem to help. Anyone have any ideas?

Thanks,  
BJ Clark

---

<div class="post-metadata">

**Author:** ![BJ\_Clark](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bc79bd/32.png) [@BJ\_Clark](https://www.ruby-forum.com/u/BJ_Clark)\
**Post date:** [January 21, 2007, 12:03am UTC](https://www.ruby-forum.com/t/how-to-move-from-trunk-to-mental/82284/8 "2007-01-21T00:03:44Z")

</div>

BJ,

If you’re using Apache on the frontend, you’ll also want to use the  
‘RewriteBase’ directive in your .htaccess file.

Sean

---

<div class="post-metadata">

**Author:** ![BJ\_Clark](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bc79bd/32.png) [@BJ\_Clark](https://www.ruby-forum.com/u/BJ_Clark)\
**Post date:** [January 30, 2007, 5:18am UTC](https://www.ruby-forum.com/t/how-to-move-from-trunk-to-mental/82284/9 "2007-01-30T05:18:54Z")

</div>

Hello All,  
I’m still having this issue and it’s the only thing stopping me from  
launching at this point.  
Here’s the issue all over again:  
My site is at [domain.com/content/](http://domain.com/content/)  
However, lots of links are trying to load /page\_name or /admin/page  
not /content/admin/page.

I have tried:  
.htacces has a line that says: " RewriteBase /content"

environment.rb has a line that says:  
“ActionController::AbstractRequest.relative\_url\_root = “/content””

Anyone have any ideas? I have no idea what else to do.  
BJ Clark

---

<div class="post-metadata">

**Author:** ![BJ\_Clark](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bc79bd/32.png) [@BJ\_Clark](https://www.ruby-forum.com/u/BJ_Clark)\
**Post date:** [January 21, 2007, 3:20am UTC](https://www.ruby-forum.com/t/how-to-move-from-trunk-to-mental/82284/10 "2007-01-21T03:20:00Z")

</div>

Sean,  
Thanks for you help again. I’ll try to figure that out.  
I just don’t understand what has changed that I need to do all this.  
the svn trunk of radiant didn’t have these url problems. Is something  
different in Mental with regards to urls?  
BJ

---

<div class="post-metadata">

**Author:** ![BJ\_Clark](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bc79bd/32.png) [@BJ\_Clark](https://www.ruby-forum.com/u/BJ_Clark)\
**Post date:** [January 30, 2007, 5:28am UTC](https://www.ruby-forum.com/t/how-to-move-from-trunk-to-mental/82284/11 "2007-01-30T05:28:54Z")

</div>

Have a look at this message:

[http://lists.radiantcms.org/pipermail/radiant/2007-January/003149.html](http://lists.radiantcms.org/pipermail/radiant/2007-January/003149.html)

---

<div class="post-metadata">

**Author:** ![BJ\_Clark](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bc79bd/32.png) [@BJ\_Clark](https://www.ruby-forum.com/u/BJ_Clark)\
**Post date:** [January 31, 2007, 5:23am UTC](https://www.ruby-forum.com/t/how-to-move-from-trunk-to-mental/82284/12 "2007-01-31T05:23:28Z")

</div>

> Thanks Daniel, I’ll look into that.
> 
> Here’s what I don’t understand. This problem has only occured after I  
> switched to Mental. It was not a problem, even though the install was  
> exactly the same, under the regular svn trunk. What has changed?  
> That’s what is so aggravating.
> 
> BJ

Looking at the source for the current trunk, I don’t see how it could  
have worked for subdirs then. The ‘url’ tag called Page#url directly  
which delegated to Behaviour#page\_url and at no point does it look at  
the request to determine the root path, at least that I can see.

Dan.

---

<div class="post-metadata">

**Author:** ![BJ\_Clark](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bc79bd/32.png) [@BJ\_Clark](https://www.ruby-forum.com/u/BJ_Clark)\
**Post date:** [January 31, 2007, 4:59am UTC](https://www.ruby-forum.com/t/how-to-move-from-trunk-to-mental/82284/13 "2007-01-31T04:59:27Z")

</div>

Thanks Daniel, I’ll look into that.

Here’s what I don’t understand. This problem has only occured after I  
switched to Mental. It was not a problem, even though the install was  
exactly the same, under the regular svn trunk. What has changed?  
That’s what is so aggravating.

BJ
