- Babble On - http://mt4.juneeonline.com/babble-on/ -
Using the Command Line for Fast Upgrades
Posted By babylon On August 23, 2008 7:11 PM In Computing | 5 Comments
My site is hosted on [1] Dreamhost, and the reason I signed up with them was so I could use a command line for direct access to my hosting account on the web server to easily configure accounts, transfer large files, setup cron jobs, make backups, etc. No more hours of waiting for conventional FTP installs! I use [2] WinSCP, an open source SFTP client and FTP client for Windows. Its main function is the secure file transfer between a local and a remote computer. Beyond this, WinSCP offers basic file manager functionality. It uses Secure Shell (SSH) and supports, in addition to Secure FTP, also legacy SCP protocol.
Prior to using this program, I used a conventional FTP program to upload the uncompressed Movable Type install. The process was slow and could take a couple of hours to move all the files to the server. It's no wonder that some people put off upgrading their installations. These days I just upload the compressed file to my server, uncompress using the secure shell command and drag and drop files and folders. The whole process takes less than half an hour.
Today a read a [3] fantastic tip on movabletype.org that has cut the upgrade process down considerably more. Upgrading from MT4.2 to MT4.21 took less than 3 minutes. I'm using Movable Type Pro so my instructions vary slightly to those posted by [4] phretor.myopenid.com.
First, you need to know the path to the version of MT that you're upgrading. Go to the download page and choose your download format (zip or tar.gz). Either will work but the command will be different. Click to download but cancel the actual download. You don't need to download the file. You'll see a thank you page with a link to directly download the file if the automatic download doesn't start.
If your download does not begin within 5 seconds click here.
Use your mouse to right click on the "click here" link and choose to copy the link location.
Open your secure shell window (or command line interface) and navigate to the folder that has your mt folder in it.
Enter the following lines into the command line:
$ cp -pR mt mt-bak
$ wget wget http://www.movabletype.com/downloads/blogger/MT-4.21-en.tar.gz
$ tar xvfz MT-4.21-en.tar.gz
$ rsync -a --progress MT-4.21-en/ mt/
The first line creates a backup of your mt folder.
The second line gets the file from Movable Type and puts it into the folder. You can paste the path in that you saved previously.
The third line uncompresses the file. If you saved the link for the zip file, change tar xvfz to unzip.
The fourth line uses the rsync command to copy the files that have changed in the new version.
If you have the mt-static folder in a different location, rename the one inside the mt folder to mt-static-new and drag it across to the same directory as the old version. Type in the following line:
$ rsync -a --progress mt-static-new/ mt-static/
Any files that have changed in the mt-static folder will be upgraded.
Before deleting any folders or files on the server, log in to MT and go through the upgrade process to make sure everything went smoothly.
A great [5] tutorial on Dreamhost's Wiki explains in detail how to do an automated MySQL database backup, with the option to zip the file and email it to you. Instructions are also available for a complete domain backup.
Article printed from Babble On: http://mt4.juneeonline.com/babble-on/
URL to article: http://mt4.juneeonline.com/babble-on/archives/2008/08/using-the-command-line-for-fast-upgrades.php
URLs in this post:Click here to print.
Copyright © August 23, 2008. All rights reserved.