installing movable type 4 on godaddy

lookout_november.jpg
I have just updated the site to Movable Type 4 from Movable Type 3.2. Before I get into anything about the new features or new interface, I want to say a thing or two about installation and upgrade.
Six Apart recommends that you make a backup of your Movable Type directory before upgrading. This is a good idea. Do this. They also recommend you overwrite your old installation on the server with the new installation. This is a bad idea. Do not do this. In the event of server incompatibility or an upload error with any one of the hundreds of files required to run Movable Type, your website will be cripled until you can find out what is wrong. Sometimes it can take several days to pin point the problem, which is unacceptable.
This is what I recommend doing:

  1. Make a backup of your database. If you are on a MySQL database, export this and save it to your hard drive.
  2. Make a new database in MySQL. Write down your new database info somewhere.
  3. On the server, duplicate your Movable Type CGI directory, where the application is. This includes mt-config.cgi etc. Name the duplicate directory “mt4” or something to that effect. Keep it in the CGI directory. It belongs there. The new folder should be in a path like “/cgi-bin/mt4/” or “/cgi/mt4/”
  4. Download Movable Type 4.
  5. Uncompress the files. Configure mt-config.cgi to have your new database login info – database user, database password, database name, database server address.
  6. Upload the files to the server, now overwriting the “mt4” copy of your old installation files. If you are on a finicky host like Godaddy, use passive mode in FTP.
  7. Open up the Database backup on your hard drive in a plain text editor and remove the line “CREATE DATABASE [name of your old database];”. Also change the line that says “USE [name of your old database];” and change the name to that of your new database.
  8. In your new database, import the modified database backup. Voila, you now have a copy of your current site’s data that you can use with the new installation.
  9. Set permissions to 755 on all .CGI’s
  10. Go to http://www.yoursite.com/cgi/mt4/mt.cgi – it will start upgrading the copy of your database to be compatible with the new bits of Movable Type 4.
  11. Set your password again when upgrading is complete. Re-assign all publishing to a test directory like http://www.yoursite.com/mt4test/ – if you have special index templates like I do, you will want to redirect the publishing locations to this new test directory. Congratulations, you have a virtual development environment now.
  12. Test your site, including all your plugins. Check out the new nifty plugins area in Preferences. I lost one (Digg.com auto-linker) plugin and I had to take code out of my templates. Good to test since this would have caused Movable Type to not be able to build any of my individual entries, of which makes up the majority of my site.
  13. Looking good? Great. Then change the publishing directory back to the main index of the site in preferences. (Just take out “mt4test/”). You are in business now. To be safe, you should remove access to the old Movable Type CGI folder. Rename it or delete it – it is up to you. I renamed mine for backup purposes should anything heinous happen to this installation.

This is a few more steps than what Six Apart suggests, but there are benefits:

  1. You will not be messing with your live site while testing because you have created a testing environment which does not interact with your original installation in any way.
  2. This gives you a chance to iron out the upgrade bugs – and it doesn’t matter what anyone says, there are always upgrade anomalies which you will have to deal with. Plan on it.
  3. The testing environment has all the data, all your templates, but virtually no risk because if there was a problem with an upload or configuration, you can simply reupload without worrying about how long your site will be down for. Your public site wont be down at all.

This is simply making a “development server” out of a testing folder. New set of CGI’s, new database to work with. This is standard practice in any web development environment and can save you a load of worry when doing something as precarious as updating a content management system over FTP. It’s a pretty delicate operation.
One other thing:
Installing Movable Type 4 on a Godaddy server. Ah yes maybe you are looking at this page because you googled that exact term. This is for you then:

#!/usr/bin/perl -w -I/home/content/d/a/v/davinzona/html/cgi/mt4/lib/
$ENV{SCRIPT_NAME} =~ s/-bin\/sbox//;

If you find yourself hosting your Movable Type powered website on a Godaddy server, then you have probably heard that it can’t be done. It’s not true. Change this:
“/d/a/v/davinzona”
to your username, like:
“/t/r/i/tripleg”
And put those two lines into all of your .CGI files at the top of each one near the header. Also add it to the file /lib/MT/Bootstrap.pm inside of your Moveable Type 4 CGI folder.
Okay folks. I can’t sleep tonight because I heard it might snow and I am too excited. This is a lot better than being up because my server is on the fritz. Hope this helps someone. Let me know if it did. Any questions, please leave a comment.

Join the Conversation

7 Comments

  1. Glad you finally got it working. One of these days I’ll probably be going down that same painfull upgrade path… not yet though. GREAT photo in this post btw~!

  2. whoa, awesome shot!!! I love it, esp the inclusion of the concrete right by the camera. really gives a sense of depth.
    and thank you for the upgrade instructions! was thinking of doing that myself at some point but couldn’t quite bring myself to do it. think maybe i’ll give it a shot now.

  3. Hi,
    I know that this is an old post, but I have also hit the MT / Godaddy wall.
    All of my permissions etc. are correct, and locations / paths are correct. I did exactly as you have stated in regards to the 2 lines of code here… But it still won’t complete the install! Stuck in initializing database.
    Do I need to replace SCRIPT_NAME with the name of the CGI file maybe?

  4. Hey Matt,
    Make sure you have this line at the top of ALL your CGI files:
    #!/usr/bin/perl -w -I/home/content/m/a/t/mattsusername/html/cgi/mt4/lib/$ENV{SCRIPT_NAME} =~ s/-bin\/sbox//;
    Also add it to the file /lib/MT/Bootstrap.pm inside of your Moveable Type 4 CGI folder.
    If this fails, I’d recommend ditching Godaddy and using Dreamhost. I switched over in the winter and have been very happy with my decision. Good luck!

Leave a comment