« Redhead | Main | That Wasn't Fun »

January 21, 2010

Upgrading to Movable Type 4.33 (Nightmare - Turn Back!)

I'm in the process up upgrading from Moveable Type 4.2 to 4.33. Downloaded MT_4.33-en.

Movable Type 4.33 requires the following applications:
Perl 5.6.1 or greater;
A web server like Apache, or Windows IIS;
Access to a database like MySQL, SQLite or Postgres;
The following Perl modules:
DBI
Image::Size
CGI::Cookie

I'm running ActivePerl 5.8.6.811
Apache 2.0.63
MySQL 4.1.10

Now, I need to verify that I'm running the necessary Perl modules.

========================================
Installing Missing Perl Modules
========================================

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.


C:\>cd perl

C:\Perl>cd bin

C:\Perl\bin>ppm query *

Querying target 1 (ActivePerl 5.8.6.811)
1. ActivePerl-DocTools [0.04] Perl extension for Documentation TOC Gene~
2. ActiveState-Relocat~ [0.03] Relocate a Perl installation
3. ActiveState-Rx [0.60] Regular Expression Debugger
4. Archive-Tar [1.22] Manipulates TAR archives
5. Compress-Zlib [1.33] Interface to zlib compression library
6. Data-Dump [1.06] Pretty printing of data structures
7. DB_File [1.810] Perl5 access to Berkeley DB version 1.x
8. DBD-mysql [2.9003] MySQL driver for the Perl5 Database Inter~
9. DBI [1.47] Database independent interface for Perl
10. Digest-HMAC [1.01] Keyed-Hashing for Message Authentication
11. Digest-MD2 [2.03] Perl interface to the MD2 Algorithm
12. Digest-SHA1 [2.10] Perl interface to the SHA-1 Algorithm
13. File-CounterFile [1.04] Persistent counter class
14. Font-AFM [1.19] Interface to Adobe Font Metrics files
15. HTML-Parser [3.38] HTML parser class
16. HTML-Tagset [3.03] Data tables useful in parsing HTML
17. HTML-Tree [3.18] build and scan parse-trees of HTML
18. IO-String [1.06] Is an IO::File compatible class that read~
19. IO-Zlib [1.04] IO:: style interface to Compress::Zlib
20. libwin32 [0.24] A collection of extensions that aims to p~
21. libwww-perl [5.801] Library for WWW access in Perl
22. MD5 [2.03] Perl interface to the MD5 Algorithm (obso~
23. PPM3 [3.1] Perl Package Manager: locate, install, up~
24. SOAP-Lite [0.55] Library for Simple Object Access Protocol~
25. Tk [804.027] A Graphical User Interface Toolkit
26. URI [1.35] Uniform Resource Identifiers (absolute an~
27. Win32-AuthenticateU~ [0.02] Win32 User authentication for domains
28. XML-Parser [2.34] A Perl module for parsing XML documents
29. XML-Simple [2.12] Easy API to read/write XML (esp config fi~

C:\Perl\bin>

So, it looks like I have DBI installed, but not "Image::Size" or "CGI::Cookie".

I tried to install the modules this way, but no dice.

C:\Perl\bin> -MCPAN -e 'install Image::Size'
'-MCPAN' is not recognized as an internal or external command,
operable program or batch file.

perl -MImage::Size -e 1
perl -MCGI::Cookie -e 1


C:\Perl\bin>perl -MImage::Size -e 1
Can't locate Image/Size.pm in @INC (@INC contains: C:/Perl/lib C:/Perl/site/lib
.).
BEGIN failed--compilation aborted.

C:\Perl\bin>perl -MCGI::Cookie -e 1

C:\Perl\bin>

So, this makes me thing that maybe CGI::Cookie is already installed, but not Image::Size?


Now that I have put c:\perl\bin into the path, I can type PPM anywhere and it launches a little Active Perl shell.
From the PPM shell, i type 'help' and it explains my command options under ppm.

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Rob>ppm
PPM - Programmer's Package Manager version 3.1.
Copyright (c) 2001 ActiveState Corp. All Rights Reserved.
ActiveState is a devision of Sophos.

Entering interactive shell. Using Term::ReadLine::Stub as readline library.

Type 'help' to get started.

ppm> help
Type 'help command' for more detailed help on a command.
Commands:
describe - describes packages in detail
exit - exits the program
help - prints this screen, or help on 'command'
install - installs packages
profiles - manage PPM profiles
properties - describes installed packages in detail
q - exits the program
query - queries installed packages
quit - exits the program
remove - uninstalls packages
repository - adds, removes, or sets repositories
s - searches for packages in a repository
search - searches for packages in a repository
settings - view or set PPM options
targets - views or sets target installer backends
tree - shows package dependency tree
uninstall - uninstalls packages
unset - view or set PPM options
upgrade - shows availables upgrades for installed packages
version - displays the PPM version (3.1)
Extra Help Topics: (not commands)
ppm_migration - guide for those familiar with PPM
prompt - how to interpret the PPM prompt
quickstart - a crash course in using PPM
unicode - notes about unicode author names

ppm> describe image::size
Wildcards detected; using 'search' instead...
Searching in Active Repositories
1. Image-Size [3.1] A library to extract height/width from images
ppm>

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Rob>ppm
PPM - Programmer's Package Manager version 3.1.
Copyright (c) 2001 ActiveState Corp. All Rights Reserved.
ActiveState is a devision of Sophos.

Entering interactive shell. Using Term::ReadLine::Stub as readline library.

Type 'help' to get started.

ppm> help
Type 'help command' for more detailed help on a command.
Commands:
describe - describes packages in detail
exit - exits the program
help - prints this screen, or help on 'command'
install - installs packages
profiles - manage PPM profiles
properties - describes installed packages in detail
q - exits the program
query - queries installed packages
quit - exits the program
remove - uninstalls packages
repository - adds, removes, or sets repositories
s - searches for packages in a repository
search - searches for packages in a repository
settings - view or set PPM options
targets - views or sets target installer backends
tree - shows package dependency tree
uninstall - uninstalls packages
unset - view or set PPM options
upgrade - shows availables upgrades for installed packages
version - displays the PPM version (3.1)
Extra Help Topics: (not commands)
ppm_migration - guide for those familiar with PPM
prompt - how to interpret the PPM prompt
quickstart - a crash course in using PPM
unicode - notes about unicode author names
ppm> describe image
Error: Package 'image' not found. Please 'search' for it first.
ppm> describe image::size
Wildcards detected; using 'search' instead...
Searching in Active Repositories
1. Image-Size [3.1] A library to extract height/width from images
ppm>
ppm>
ppm> describe Image-Size
====================
Name: Image-Size
Version: 3.1
Author: Randy J Ray (rjray@blackperl.com)
Title: Image-Size
Abstract: A library to extract height/width from images
Location: ActiveState PPM2 Repository
Available Platforms:
1. MSWin32-x86-multi-thread-5.8
====================
ppm>


Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Rob>ppm
PPM - Programmer's Package Manager version 3.1.
Copyright (c) 2001 ActiveState Corp. All Rights Reserved.
ActiveState is a devision of Sophos.

Entering interactive shell. Using Term::ReadLine::Stub as readline library.

Type 'help' to get started.

ppm> help
Type 'help command' for more detailed help on a command.
Commands:
describe - describes packages in detail
exit - exits the program
help - prints this screen, or help on 'command'
install - installs packages
profiles - manage PPM profiles
properties - describes installed packages in detail
q - exits the program
query - queries installed packages
quit - exits the program
remove - uninstalls packages
repository - adds, removes, or sets repositories
s - searches for packages in a repository
search - searches for packages in a repository
settings - view or set PPM options
targets - views or sets target installer backends
tree - shows package dependency tree
uninstall - uninstalls packages
unset - view or set PPM options
upgrade - shows availables upgrades for installed packages
version - displays the PPM version (3.1)
Extra Help Topics: (not commands)
ppm_migration - guide for those familiar with PPM
prompt - how to interpret the PPM prompt
quickstart - a crash course in using PPM
unicode - notes about unicode author names
ppm> describe image
Error: Package 'image' not found. Please 'search' for it first.
ppm> describe image::size
Wildcards detected; using 'search' instead...
Searching in Active Repositories
1. Image-Size [3.1] A library to extract height/width from images
ppm>
ppm>
ppm> describe Image-Size
====================
Name: Image-Size
Version: 3.1
Author: Randy J Ray (rjray@blackperl.com)
Title: Image-Size
Abstract: A library to extract height/width from images
Location: ActiveState PPM2 Repository
Available Platforms:
1. MSWin32-x86-multi-thread-5.8
====================
ppm> install Image-Size
====================
Install 'Image-Size' version 3.1 in ActivePerl 5.8.6.811.
====================
Downloaded 23640 bytes.
Extracting 27/27: blib/arch/auto/Image/Size/.exists
Installing C:\Perl\html\bin\imgsize.html
Installing C:\Perl\html\site\lib\Image\Size.html
Installing C:\Perl\site\lib\auto\Image\Size\autosplit.ix
Installing C:\Perl\site\lib\auto\Image\Size\bmpsize.al
Installing C:\Perl\site\lib\auto\Image\Size\gifsize.al
Installing C:\Perl\site\lib\auto\Image\Size\jpegsize.al
Installing C:\Perl\site\lib\auto\Image\Size\mngsize.al
Installing C:\Perl\site\lib\auto\Image\Size\pcdsize.al
Installing C:\Perl\site\lib\auto\Image\Size\pngsize.al
Installing C:\Perl\site\lib\auto\Image\Size\ppmsize.al
Installing C:\Perl\site\lib\auto\Image\Size\psdsize.al
Installing C:\Perl\site\lib\auto\Image\Size\swfmxsize.al
Installing C:\Perl\site\lib\auto\Image\Size\swfsize.al
Installing C:\Perl\site\lib\auto\Image\Size\tiffsize.al
Installing C:\Perl\site\lib\auto\Image\Size\xbmsize.al
Installing C:\Perl\site\lib\auto\Image\Size\xpmsize.al
Installing C:\Perl\site\lib\Image\Size.pm
Installing C:\Perl\bin\imgsize
Installing C:\Perl\bin\imgsize.bat
Successfully installed Image-Size version 3.1 in ActivePerl 5.8.6.811.
ppm>

ppm> query *
Querying target 1 (ActivePerl 5.8.6.811)
1. ActivePerl-DocTools [0.04] Perl extension for Documentation TOC Gene~
2. ActiveState-Relocat~ [0.03] Relocate a Perl installation
3. ActiveState-Rx [0.60] Regular Expression Debugger
4. Archive-Tar [1.22] Manipulates TAR archives
5. Compress-Zlib [1.33] Interface to zlib compression library
6. Data-Dump [1.06] Pretty printing of data structures
7. DB_File [1.810] Perl5 access to Berkeley DB version 1.x
8. DBD-mysql [2.9003] MySQL driver for the Perl5 Database Inter~
9. DBI [1.47] Database independent interface for Perl
10. Digest-HMAC [1.01] Keyed-Hashing for Message Authentication
11. Digest-MD2 [2.03] Perl interface to the MD2 Algorithm
12. Digest-SHA1 [2.10] Perl interface to the SHA-1 Algorithm
13. File-CounterFile [1.04] Persistent counter class
14. Font-AFM [1.19] Interface to Adobe Font Metrics files
15. HTML-Parser [3.38] HTML parser class
16. HTML-Tagset [3.03] Data tables useful in parsing HTML
17. HTML-Tree [3.18] build and scan parse-trees of HTML
18. Image-Size [3.1] A library to extract height/width from im~
19. IO-String [1.06] Is an IO::File compatible class that read~
20. IO-Zlib [1.04] IO:: style interface to Compress::Zlib
21. libwin32 [0.24] A collection of extensions that aims to p~
22. libwww-perl [5.801] Library for WWW access in Perl
23. MD5 [2.03] Perl interface to the MD5 Algorithm (obso~
24. PPM3 [3.1] Perl Package Manager: locate, install, up~
25. SOAP-Lite [0.55] Library for Simple Object Access Protocol~
26. Tk [804.027] A Graphical User Interface Toolkit
27. URI [1.35] Uniform Resource Identifiers (absolute an~
28. Win32-AuthenticateU~ [0.02] Win32 User authentication for domains
29. XML-Parser [2.34] A Perl module for parsing XML documents
30. XML-Simple [2.12] Easy API to read/write XML (esp config fi~


Unfortunately, I don't see the CGI::Cookie Perl Module listed here. I think that it's not in the Active Perl Repository
that I'm currently using, I guess.

So, I downloaded it from here: http://search.cpan.org/~lds/CGI.pm-3.48/lib/CGI/Cookie.pm

Extracted it to C:\Perl\CGI_Cookies. Then copied eveything in it to my c:\perl\bin library.

But, when I look at it, I'm not clear at all what I've got. It says: "This is CGI.pm, an easy-to-use Perl5 library for writing World
Wide Web CGI scripts.


I went back into DOS to see if I don't have this installed already. Apparently not.

C:\Documents and Settings\Rob>perl -MImage::Size -e 1

C:\Documents and Settings\Rob>perl -MCGI::Cookies -e 1
Can't locate CGI/Cookies.pm in @INC (@INC contains: c:/Perl/lib c:/Perl/site/lib
.).
BEGIN failed--compilation aborted.

OK. After much head scratching, I've decided that I did have the right download. The download is named CGI.pm-3.48.tar.gz.
CGI is apparently something written for Perl. Cookie.pm is in a little sub library underneath CGI.pm. Basically, what
I determined was that I just needed to put these .pm files (Perl Modules) underneath my c:\Perl\Lib folder structure. Each
Perl module looks like it has a folder underneath the c:\perl\lib structure. And, lo-and-behold, I now see that there already
is a folder c:\perl\lib\CGI with cookie.pm in it. I also notice that the file c:\perl\lib\CGI.pm exists. So, this is all set up already.

Now, I wonder why it failed my little installation test(perl -MCGI::Cookies -e 1)?

OK. I had to take the "s" off of cookies. Doh!

C:\Documents and Settings\Rob>perl -MCGI::Cookie -e 1

C:\Documents and Settings\Rob>

OK. Since I didn't get an error, this means that it is installed.


===============================
Upgrading MT
===============================

Shut down web server.
Copied mt folder over to mt_old_4.2
Copied mt-static folder over to mt-static_old_42
Moved all of my new files from mt-static into the existing mt-static folder.
Moved all of my new files from the new 4.33 mt folder into the existing mt folder.
Deleted my new temporary mt_433 folder.
Started Apache.
Signed into MT and began the Upgrade process.

* Upgrading database from version 4.0067.
* Upgrading table for MT::Entry::Summary records...
* Upgrading table for MT::Author::Summary records...
* Upgrading table for as_ua_cache records...
* Upgrading table for ActionStreams::Event::Meta records...
* Upgrading table for profileevent records...
* Upgrading table for User records...
* Upgrading table for TrackBack records...
* Upgrading table for TrackBacks records...
* Upgrading table for IP Ban records...
* Upgrading table for Object Score records...
* Upgrading table for Comment records...
* Upgrading table for Entry records...
* Upgrading table for Asset Placement records...
* Upgrading table for Field records...
* Upgrading table for Job Error records...
* Upgrading table for Comment records...
* Creating new template: 'Comment Listing'.
* Creating new template: 'Comment Listing'.
* Creating new template: 'New Password Form'.
* Creating new template: 'New Password Reset Form'.
* Updating password recover email template...
* Updating Universal Template Set to Professional Website set... (100%)
* Database has been upgraded to version 4.0076.
* Plugin 'Professional Pack' upgraded successfully to version 1.31 (schema version 1.4).
* Plugin 'Community Pack' upgraded successfully to version 1.64 (schema version 1.62).
* Plugin 'Action Streams' installed successfully.
* Plugin 'Motion' installed successfully.

Upgrade Complete!

Then, at the MT home page for my website, it says:

Image::Magick is either not present on your server or incorrectly configured. Due to that, you will not be able to use Movable Type's userpics feature. If you wish to use that feature, please install Image::Magick or use an alternative image driver.


Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Rob>ppm
PPM - Programmer's Package Manager version 3.1.
Copyright (c) 2001 ActiveState Corp. All Rights Reserved.
ActiveState is a devision of Sophos.

Entering interactive shell. Using Term::ReadLine::Stub as readline library.

Type 'help' to get started.

ppm> describe Image::Magick
Wildcards detected; using 'search' instead...
Searching in Active Repositories
1. Image-Magick-Square [1.002] Takes image and crops to a square
2. Image-Magick-Thumbn~ [0.04] Perl extension for creating fixed sized thum~
ppm> install Image-Magick-Square
====================
Install 'Image-Magick-Square' version 1.002 in ActivePerl 5.8.6.811.
====================
Downloaded 2549 bytes.
Extracting 5/5: blib/arch/auto/Image/Magick/Square/.exists
Installing C:\Perl\html\site\lib\Image\Magick\Square.html
Installing C:\Perl\site\lib\Image\Magick\Square.pm
Successfully installed Image-Magick-Square version 1.002 in ActivePerl 5.8.6.811
.
ppm>

Still see the same message:
Image::Magick is either not present on your server or incorrectly configured. Due to that, you will not be able to use Movable Type's userpics feature. If you wish to use that feature, please install Image::Magick or use an alternative image driver.

http://search.cpan.org/~jcristy/PerlMagick-6.58/Magick.pm

I copied the PerlMagick-6.58 folder to c:\perl\lib\PerlMagick-6.58.

C:\DOCUME~1\ROB>perl -MImage::Magick -e 1
Can't locate Image/Magick.pm in @INC (@INC contains: c:/Perl/lib c:/Perl/site/li
b .).
BEGIN failed--compilation aborted.

Didn't work. So, I copied the PerlMagick folder back.

I finally edited the .htaccess file to stop the redirects to index.php. I put in an index.html that says 'we spilled beer'.
So, I have an error message up at least.

I finally found my templates. I had to go into a website (peeniewallie) instead of being the overview section.
Then, I backed up my main index template and started trying to just cobble something together. Errors from missing
templates I think.

So, I tried to do a Design - Styles thing, but got this error. So, it makes me think that it can't find my
mt-static folder.

Error loading themes! -- Invalid URL: http://www.peeniewallie.com../mt-static/addons/Commercial.pack/themes/professional.html

Tools - Activity Log. I cleared 85,000 entries out of the activity log.

OK. Something in my section of the Main Index appears to be making the main index page all Black. Not sure why.

For some reason, this makes it all black.

So, I looked at the styles-site.css file, and it's way different than the old one. So, I renamed it styles-site.css_new
and restored the old one.

Something is majorly fvcked with the styles-site.css stylesheet. I can't figure out what it is though.

OK. I removed my code from the my old Main Index Template and, although the formatting is whacked, I've definitely determined
that his problem is somehow related to the stupid styles-site.css file. For some reason, that's blacking everything out.

Eventually, what I realized is that MT 4.33 has a radical change in the way that the Cascading Style Sheets (styles-site.css) are handled. The style sheets are split into multiple sheets, and, whereas I was setting up all of my stylesheets in one document, they're now spread across multiple documents.

Not only are the style sheets split up, but they're also relocated. They're stored in the mt-static folder in MT 4.33. The problem with this is that there appear to be some errors relating to the MT application not being able to locate my mt-static folder as it's outside of the MT directory.

Additionally, the templates are completely redesigned. They're split into many different templates, and the problem with this is that I had all of my HTML code in my Main Index Template. However, the MT application was pulling in it's own code for things like HTML, Title, Body, etc. So, the web page was all screwed up because entire sections of code were repeated. It was, in short, a nightmare. And at the end of the day, I said "forget it - it's not worth it." And I decided to back everything out.


==================================
Restoring Backup of MYSQL Database:
==================================

mysqladmin -u root password mypassword
mysqld
net start mysql
net stop mysql


C:\MYSQL\BIN>mysql -uroot -pnewark01
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4 to server version: 4.1.10

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.


mysql> show databases;
+----------+
| Database |
+----------+
| mysql |
| pw |
+----------+
2 rows in set (0.03 sec)

mysql> use pw
Database changed
mysql> show tables;


http://www.sixapart.com/movabletype/docs/3.2/01_installation_and_upgrade/mysql_backup_restore.html

Backing up via the command line


To backup from the command line of your shell account, log in and type the following at the prompt replacing USERNAME and DATABASE as described previously:

mysqldump -a -u USERNAME -p DATABASE > FILENAME.mysql

You will be prompted for your database password and then the DATABASE will be dumped to a plain-text file called FILENAME.mysql.

The resulting file, FILENAME.mysql, is a full backup with which you can fully restore your database in case of problems.
Restoring via the command line

Restoring from FILENAME.mysql is a three step process:

1. Drop the database

mysqladmin -u USERNAME -p drop DATABASE

2. Recreate the database

mysqladmin -u USERNAME -p create DATABASE

3. Import the backup data

mysql -u USERNAME -p DATABASE < FILENAME.mysql

mysql> select * from mt_config;

MTVersion 4.33

C:\MYSQL\BIN>net start mysql
The MySql service is starting.
The MySql service was started successfully.

Hmmm. I found that I was making good backups of the entire c:\mysql directory.
So, first, I made a good mysql dump of the database.

C:\MYSQL\BIN>mysqldump -a -uroot -pnewark01 pw > c:\pw_backup_433.sql

Then, I stopped the database and made a good full-on copy
of the mysql directory structure to c:\mysql_backup_433.

C:\MYSQL\BIN>net stop mysql
The MySql service is stopping..
The MySql service was stopped successfully.


Then I carefully restored the c:\mysql directory structure data from the t:\mysql backups,
hoping that I'll be back to MTVersion 4.22.

OK. Copied it over. Now to start the database and check the version.

mysql -uroot -pnewark01

C:\MYSQL\BIN>net start mysql
The MySql service is starting.
The MySql service was started successfully.

C:\MYSQL\BIN>mysql -uroot -pnewark01
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 4.1.10

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> use pw;
Database changed

mysql> select * from mt_config;

MTVersion 4.2

Woohoo! Looks like I've restored the MySQL database back to the old MT 4.2 version anyway.
Thank god for small miracles.

Now, to restore the MT directory and mt-static directories.

I created mt_433 and mt-static_433 and moved everything from mt to mt_433 and from mt-static to mt-static_433.

Then, I copied everything from mt_old_422 to mt and from mt-static_old_422 to mt-static.

Changed my mysqldump bat file to include the -a option.

Fixed the apache .htaccess file.

Fixed the apache conf.http file.

Posted by Rob Kiser on January 21, 2010 at 12:21 AM

Comments

Post a comment




Remember Me?

(you may use HTML tags for style)


NOTICE: IT WILL TAKE APPROX 1-2 MINS FOR YOUR COMMENT TO POST SUCCESSFULLY. YOU WILL HAVE TO REFRESH YOUR BROWSER. PLEASE DO NOT DOUBLE POST COMMENTS OR I WILL KILL YOU.