Changing Hostname of Mephisto Blog

Recently I was developing a new website under Mephisto and multisite config. I developed site under temporary hostname. Below are the steps needed to change hostname of running Mephisto instance.

Lets assume old host of the site was dev.example.com. New host will be www.example.com.

In table sites update column host to have value example.com. Also update Apache config to understand the new hostname. Now Mephisto is ready to answer in new hostname.

Articles containing images or other assets still have old hostname in their url. They can be easily changed with MySQL’s REPLACE command. Four columns have to be updated in contents table:

UPDATE contents SET body = REPLACE; UPDATE contents SET body_html = REPLACE; UPDATE contents SET excerpt_html = REPLACE; UPDATE contents SET excerpt = REPLACE;

Last thing to change is the name of asset directory under mephisto folder.

 >cd /www/mephisto/public/assets 
 >mv dev.example.com www.example.com

Thats it. Fire up you browser. Clear caches from Mephisto admin and check everything is ok.

UPDATE: There still seems to be problem with new assets being uploaded to wrong folder. Temporary fix for this is to make a symlink:

 >cd /www/mephisto/public/assets 
 >ln -s www.example.com example.com

I’m sure there is a better way.

Tagged with: Mephisto   Rails  

Most read tags

Lazy Load   Ruby   AVR  
Electronics   JavaScript  
Jeditable   Maps   jQuery  
Facebook   HTML5   Lazy Load  
Estonia