Jump to content
chroniker

Converting From Mt To Wp

Recommended Posts

On the wordpress site the instructions for converting from MT to WP say

 

This tutorial has been tried and tested using MovableType V 2.63 and WordPress 1.0.2

 

Does anyone know if these instructions are valid for MT 3.15 and WP 1.5.1.2?

Share this post


Link to post
Share on other sites

I don't know about the WordPress side of the instructions, but the MT side is just a straight export of the entries from mt.cgi. MT 3.15 exports in the same format as MT 2.63, so that shouldn't cause you any problems.

Share this post


Link to post
Share on other sites

I went from MT 3.12(ish) to WP 1.5.something. Took ten minutes. Back everything up though, just in case.

Share this post


Link to post
Share on other sites

Ok, Thanks.

 

Now, another question. Since I currently have MT installed at /public_html/mt with the address of sitename.com, what is going to happen when I install WP and where do I need to put it so that the address is sitename.com and not sitename.com/wp?

Share this post


Link to post
Share on other sites

I downloaded the WP files, unpacked them on my computer and then uploaded those files to my public_html folder.

Share this post


Link to post
Share on other sites

I'm a sucker for folders, so I just redirect sitename.com to sitname.com/wp. Good just in case I ever want to remove WP, I don't have all kinds of junk cluttering my public_html folder.

Share this post


Link to post
Share on other sites

Well, if all you are going to have is a blog, then the public_html folder makes perfect sense. But if you want to install other software like a gallery, forum or even a regular web site then I agree a folder makes perfect sense.

Share this post


Link to post
Share on other sites

<_< As I've mentioned before, I'm not always the brightest lightbulb in the box and this is one of those times.

 

After I upload WP and import everything from MT I'm going to try Alex Kings templet for search engine redirects but this requires me to keep my MT installation.

 

My question now is - how do I "turn off" MT and "turn on" WP, or is this something that "just is" and I should accept it and go on?

Share this post


Link to post
Share on other sites

You can't really "turn off" MT other than to uninstall (delete) it. Similarly, since you have WP installed, it is "on", so it looks like the best course is to "accept it and go on". :) Somewhere down the line, you may decide that it's okay to remove MT and the pages generated by MT, but I wouldn't recommend doing that just yet.

Share this post


Link to post
Share on other sites

:)

Leave it to me to screw up something as simple as a WP install.

 

At */install.php, I get this:

Warning: Cannot modify header information - headers already sent by (output started at */wp-config.php:23) in */wp-admin/install.php on line 15
At step one, I get this:
Warning: Cannot modify header information - headers already sent by (output started at */wp-config.php:23) in */wp-admin/install.php on line 15

 

At step two, I get this:

Warning: Cannot modify header information - headers already sent by (output started at */wp-config.php:23) in */wp-admin/install.php on line 15
At Log-in, I get this:
Warning: Cannot modify header information - headers already sent by (output started at */wp-config.php:23) in */wp-login.php on line 7

 

Warning: Cannot modify header information - headers already sent by (output started at */wp-config.php:23) in */wp-login.php on line 8

 

Warning: Cannot modify header information - headers already sent by (output started at */wp-config.php:23) in */wp-login.php on line 9

 

Warning: Cannot modify header information - headers already sent by (output started at */wp-config.php:23) in */wp-login.php on line 10

 

Warning: Cannot modify header information - headers already sent by (output started at */wp-config.php:23) in */wp-login.php on line 11

 

After I log in, I get this:

Warning: Cannot modify header information - headers already sent by (output started at */wp-config.php:23) in */wp-login.php on line 7

 

Warning: Cannot modify header information - headers already sent by (output started at */wp-config.php:23) in */wp-login.php on line 8

 

Warning: Cannot modify header information - headers already sent by (output started at */wp-config.php:23) in */wp-login.php on line 9

 

Warning: Cannot modify header information - headers already sent by (output started at */wp-config.php:23) in */wp-login.php on line 10

 

Warning: Cannot modify header information - headers already sent by (output started at */wp-config.php:23) in */wp-login.php on line 11

 

Warning: Cannot modify header information - headers already sent by (output started at */wp-config.php:23) in */wp-includes/pluggable-functions.php on line 151

 

Warning: Cannot modify header information - headers already sent by (output started at */wp-config.php:23) in */wp-includes/pluggable-functions.php on line 152

 

Warning: Cannot modify header information - headers already sent by (output started at */wp-config.php:23) in */wp-includes/pluggable-functions.php on line 129

 

Your help would be greatly appreciated.

 

I have already removed and reuploaded WP twice.

Share this post


Link to post
Share on other sites

I found this at the Wordpress site ("Common Installation Problems"):

I see lots of Headers already sent errors. How do I fix this?

You probably introduced a syntax error in editing wp-config.php.

1. Download wp-config.php (if you don't have shell access).

2. Open it in your favorite text editor.

3. Check that the first line contains nothing but <?php, and that there is no text before it (not even whitespace).

4. Check that the last line contains nothing but ?>, and that there is no text after it (not even whitespace).

5. Save the file, upload it again if necessary, and reload the page in your browser.

Share this post


Link to post
Share on other sites
I found this at the Wordpress site ("Common Installation Problems"):

You mean there were instructions for this? :)

There were 2 blank lines following ?>

 

Thank you David.

Share this post


Link to post
Share on other sites

Ok, this is getting irritating.

 

I have uploaded Alex King's "Template to redirect MT entries to WordPress" to public_html, which is where I'm running MT, and I have tried it in public_html/blog where I've put WP and all of my archive links still go to MT.

 

I have also tried all of the following redirect.php in both places:

 

Using .htaccess for redirection

 

Matt's method uses the .htaccess file for redirection.

 

Create a Movable Type template like the following, have it output to redirect.php in your WP root directory:

 

<?php

require('wp-config.php');

header('Content-type: text/plain');

?>

<MTEntries lastn="999999">

Redirect Permanent /archives/<$MTEntryID$>.html http://www.example.org/archives/<$MTArchiveDate format="%Y/%m/%d"$>/

  <?php echo sanitize_title("<$MTEntryTitle$>"); ?>

</MTEntries>

 

If your entry IDs in MovableType are padded with zeroes (0), then change the line above to

 

Redirect Permanent /archives/<$MTEntryID pad="1"$>.html http://www.example.org/archives/<$MTArchiveDate format="%Y/%m/%d"$>/

  <?php echo sanitize_title("<$MTEntryTitle$>"); ?>

 

Also, if your used the "dirify" option, for example, when in MT, if you had:

 

    * Archive Type: Individual,

    * Archive File Template: <MTEntryTitle dirify="1">.php,

    * quotes in title etc,

 

Use:

 

Redirect Permanent /archives/<MTEntryTitle dirify="1">.php

http://www.example.com/index.php?s=<$MTEntryTitle encode_url="1"$>

 

or if the extension for the pages were ".html", instead of the ".php" above, use:

 

Redirect Permanent /archives/<$MTEntryID$>.html

http://www.example.com/index.php?s=<$MTEntryTitle encode_url="1"$>

 

What may be throwing all of this off is, I don't have a clue how to create a MT template in my WP root directory.

Share this post


Link to post
Share on other sites

The Alex King templates appear to be templates that replace MT's Individual Entry Archive template. Instead of uploading the template to your web site, what you're supposed to do is replace your existing Individual Entry Archive template with one of the supplied templates, edit the template as indicated in the instructions, save the new template, then rebuild your Individual Entry Archives. This will replace your existing Individual Entry Archive pages with pages that redirect users from the MT URL to the WP URL.

 

For Matt's method, you don't "create a MT template in your WP root directory". What you would do is create a new Index template in MT and add the supplied code to the Template Body. Then you would set the template to *output* to 'redirect.php' in your WP root directory, and you can do this by specifying the full local server path and filename in the "Output File" field. Example:

>/home/cpanelName/public_html/wp/redirect.php

Save the template, then rebuild it, and you should have your redirect.php file in the WP root directory.

 

Hope this helps...

Share this post


Link to post
Share on other sites

:D

Something is still not clicking.

 

In MT I took the Main Index Template and inserted Matt's code at the top of the page after <body> but before <div id="container">. And I have tried them at the bottom of the page after <br clear="all" /> but before <body> <div id="container">. I have even tried removing everything in the template except Matt's code and all links still go to MT entries instead of WP.

 

And yes I have replaced Matt's example path names with mine.

 

Meanwhile over in WP, using cpanel, I deleted the redirect.php that I had ftp'ed there earlier in the day and replaced it with another one. As soon as I created it, it was populated with entries like this:

 

Redirect Permanent /archives/79.html http://www.chroniker.net/blog/archives/2005/07/07/

 

Redirect Permanent /archives/78.html http://www.chroniker.net/blog/archives/2005/07/06/

 

Redirect Permanent /archives/77.html http://www.chroniker.net/blog/archives/2005/07/03/

 

Redirect Permanent /archives/75.html http://www.chroniker.net/blog/archives/2005/06/29/

 

I have noticed that in my WP install the only place I can find a file called archive or archives is in /wp-content/themes/default, and I'm not using the default theme. Does this mean anything?

Share this post


Link to post
Share on other sites
In MT I took the Main Index Template and inserted Matt's code at the top of the page after <body> but before <div id="container">. And I have tried them at the bottom of the page after <br clear="all" /> but before <body> <div id="container">. I have even tried removing everything in the template except Matt's code and all links still go to MT entries instead of WP.

It wasn't necessary to replace your Main Index template with Matt's - you could have simply created a new Index template and put Matt's code in there instead.

 

I don't know what Wordpress does with a redirect.php file, but the redirect.php file outputs Redirect directives that shoud end up in an .htaccess file. There should be *no* html in the output of this file whatsoever. (I don't think you should use Matt's code with template code that contains HTML. :) )

 

Meanwhile over in WP, using cpanel, I deleted the redirect.php that I had ftp'ed there earlier in the day and replaced it with another one.  As soon as I created it, it was populated with entries like this:

>Redirect Permanent /archives/79.html http://www.chroniker.net/blog/archives/2005/07/07/

Redirect Permanent /archives/78.html http://www.chroniker.net/blog/archives/2005/07/06/

Redirect Permanent /archives/77.html http://www.chroniker.net/blog/archives/2005/07/03/

Redirect Permanent /archives/75.html http://www.chroniker.net/blog/archives/2005/06/29/

Yeah, those are .htaccess directives that are supposed to redirect users hitting your old MT entry URLs to your new Wordpress entry URLs.

 

I have noticed that in my WP install the only place I can find a file called archive or archives is in /wp-content/themes/default, and I'm not using the default theme. Does this mean anything?

Ummm....yes! :D

 

The "/archives" URLs should be URLs to your old MT entry pages. It is a relative URL that should be equivalent to (for example):

>http://www.chroniker.net/archives/79.html

If your MT archives were not at URLs like above, then the redirects won't work.

Share this post


Link to post
Share on other sites

I haven't been this agrivated in a loooooooooonnnnnnng time.

 

I've tried going back to the defailt WP theme where there are archives and used all of Matt's code examples and nothing works.

 

It's time for me to go play DC and blow something up :D

Share this post


Link to post
Share on other sites

Obviously I've done something wrong and I can't find it. It will be this evening before I can do anything, but is there anyone here willing to help me out?

Share this post


Link to post
Share on other sites

You've got a couple of things not working in your favor at the moment:

 

1) Your Wordpress permalinks are not being generated correctly. Example: The entry that is linked with this URL:

>http://www.chroniker.net/?p=70

...is actually at this URL:

>http://www.chroniker.net/blog/?p=70

2) Your permalinks are using an entry ID number for the link instead of the entry title. This makes it difficult to set up redirects from MT archive pages to Wordpress archive pages, as the entry ID numbers are not the same. Example: Entry #79 in MT is entry #70 in Wordpress.

 

The redirects need to redirect from your actual MT archive URLs to the equivalent Wordpress archive URL. Example:

>Redirect Permanent /mt/archives/2005/07/comment_spam.php http://www.chroniker.net/blog/?p=70

If you use an MT template to generate the MT archive URLs to be redirected from, you'll need to use the following snippet of template code to get the actual URL:

>/mt/archives/<$MTEntryDate format="%Y/%m"$>/<$MTEntryBasename$>.php

As your Wordpress links currently are, you'd need to use the following snippet of code to generate a dummy Wordpress URL:

>http://www.chroniker.net/blog/?p=nn

After you've generated the list of redirects, you'd have to look up the Wordpress entry ID numbers and replace the "nn" in each directive with the correct Wordpress entry ID number.

 

The full code to generate the redirects would look like this:

><MTEntries lastn="999999">
Redirect Permanent /mt/archives/<$MTEntryDate format="%Y/%m"$>/<$MTEntryBasename$>.php http://www.chroniker.net/blog/?p=nn
</MTEntries>

Now I don't use Wordpress, but I read somewhere that you could change the format of your permalinks to use the entry title instead of the entry ID number if you wished. Both Matt's code, and Alex's templates, assume your Wordpress installation is indeed using permalinks in the format of /blog/archives/yyyy/mm/dd/entry-title/, and if you're not, you have to edit the code for the actual format of your links (like I did above with Matt's code).

 

Once you have your list of redirects, they have to be placed in an .htaccess file that is in the directory path to the MT archive files. With your MT archives starting in the /public_html/mt/archives directory, the .htaccess file with the redirects could be placed in the /public_html, /public_html/mt, or /public_html/mt/archives directories. I'd recommend putting the .htaccess file in the /public_html directory.

 

Take what I've written here with a grain of salt - as a non-Wordpress user, this is what looks like needs to happen from my point of view. Someone who actually knows Wordpress may be able to offer some better advice. :clapping:

Share this post


Link to post
Share on other sites

Go in to the Options panel of WordPress and select Permalinks. I use the default ones it suggests. Just copy and paste the code into your .htaccess file. Here's what mine looks like.

 

><IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [S=35]
RewriteRule ^feed/(feed|rdf|rss|rss2|atom)/?$ /index.php?&feed=$1 [QSA,L]
RewriteRule ^(feed|rdf|rss|rss2|atom)/?$ /index.php?&feed=$1 [QSA,L]
RewriteRule ^page/?([0-9]{1,})/?$ /index.php?&paged=$1 [QSA,L]
RewriteRule ^comments/feed/(feed|rdf|rss|rss2|atom)/?$ /index.php?&feed=$1&withcomments=1 [QSA,L]
RewriteRule ^comments/(feed|rdf|rss|rss2|atom)/?$ /index.php?&feed=$1&withcomments=1 [QSA,L]
RewriteRule ^comments/page/?([0-9]{1,})/?$ /index.php?&paged=$1 [QSA,L]
RewriteRule ^search/(.+)/feed/(feed|rdf|rss|rss2|atom)/?$ /index.php?s=$1&feed=$2 [QSA,L]
RewriteRule ^search/(.+)/(feed|rdf|rss|rss2|atom)/?$ /index.php?s=$1&feed=$2 [QSA,L]
RewriteRule ^search/(.+)/page/?([0-9]{1,})/?$ /index.php?s=$1&paged=$2 [QSA,L]
RewriteRule ^search/(.+)/?$ /index.php?s=$1 [QSA,L]
RewriteRule ^category/(.+)/feed/(feed|rdf|rss|rss2|atom)/?$ /index.php?category_name=$1&feed=$2 [QSA,L]
RewriteRule ^category/(.+)/(feed|rdf|rss|rss2|atom)/?$ /index.php?category_name=$1&feed=$2 [QSA,L]
RewriteRule ^category/(.+)/page/?([0-9]{1,})/?$ /index.php?category_name=$1&paged=$2 [QSA,L]
RewriteRule ^category/(.+)/?$ /index.php?category_name=$1 [QSA,L]
RewriteRule ^archives/author/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$ /index.php?author_name=$1&feed=$2 [QSA,L]
RewriteRule ^archives/author/([^/]+)/(feed|rdf|rss|rss2|atom)/?$ /index.php?author_name=$1&feed=$2 [QSA,L]
RewriteRule ^archives/author/([^/]+)/page/?([0-9]{1,})/?$ /index.php?author_name=$1&paged=$2 [QSA,L]
RewriteRule ^archives/author/([^/]+)/?$ /index.php?author_name=$1 [QSA,L]
RewriteRule ^archives/([0-9]{4})/feed/(feed|rdf|rss|rss2|atom)/?$ /index.php?year=$1&feed=$2 [QSA,L]
RewriteRule ^archives/([0-9]{4})/(feed|rdf|rss|rss2|atom)/?$ /index.php?year=$1&feed=$2 [QSA,L]
RewriteRule ^archives/([0-9]{4})/page/?([0-9]{1,})/?$ /index.php?year=$1&paged=$2 [QSA,L]
RewriteRule ^archives/([0-9]{4})/?$ /index.php?year=$1 [QSA,L]
RewriteRule ^archives/([0-9]{4})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$ /index.php?year=$1&monthnum=$2&feed=$3 [QSA,L]
RewriteRule ^archives/([0-9]{4})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$ /index.php?year=$1&monthnum=$2&feed=$3 [QSA,L]
RewriteRule ^archives/([0-9]{4})/([0-9]{1,2})/page/?([0-9]{1,})/?$ /index.php?year=$1&monthnum=$2&paged=$3 [QSA,L]
RewriteRule ^archives/([0-9]{4})/([0-9]{1,2})/?$ /index.php?year=$1&monthnum=$2 [QSA,L]
RewriteRule ^archives/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$ /index.php?year=$1&monthnum=$2&day=$3&feed=$4 [QSA,L]
RewriteRule ^archives/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$ /index.php?year=$1&monthnum=$2&day=$3&feed=$4 [QSA,L]
RewriteRule ^archives/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/page/?([0-9]{1,})/?$ /index.php?year=$1&monthnum=$2&day=$3&paged=$4 [QSA,L]
RewriteRule ^archives/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/?$ /index.php?year=$1&monthnum=$2&day=$3 [QSA,L]
RewriteRule ^archives/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$ /index.php?year=$1&monthnum=$2&day=$3&name=$4&feed=$5 [QSA,L]
RewriteRule ^archives/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/(feed|rdf|rss|rss2|atom)/?$ /index.php?year=$1&monthnum=$2&day=$3&name=$4&feed=$5 [QSA,L]
RewriteRule ^archives/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/page/?([0-9]{1,})/?$ /index.php?year=$1&monthnum=$2&day=$3&name=$4&paged=$5 [QSA,L]
RewriteRule ^archives/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)(/[0-9]+)?/?$ /index.php?year=$1&monthnum=$2&day=$3&name=$4&page=$5 [QSA,L]
RewriteRule ^archives/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([^/]+)/trackback/?$ /index.php?year=$1&monthnum=$2&day=$3&name=$4&tb=1 [QSA,L]
</IfModule>

 

This will produce links like this: http://your-blog-address/2005/07/13/sample-post/

Share this post


Link to post
Share on other sites

David,

Admittadly I have not made all of the corrections you reccomended here.

 

Could that be causing all of the this?

 

1) Your Wordpress permalinks are not being generated correctly. Example: The entry that is linked with this URL:

CODEhttp://www.chroniker.net/?p=70

...is actually at this URL:

CODEhttp://www.chroniker.net/blog/?p=70

 

2) Your permalinks are using an entry ID number for the link instead of the entry title. This makes it difficult to set up redirects from MT archive pages to Wordpress archive pages, as the entry ID numbers are not the same. Example: Entry #79 in MT is entry #70 in Wordpress.

 

The redirects need to redirect from your actual MT archive URLs to the equivalent Wordpress archive URL. Example:

CODERedirect Permanent /mt/archives/2005/07/comment_spam.php http://www.chroniker.net/blog/?p=70

If you use an MT template to generate the MT archive URLs to be redirected from, you'll need to use the following snippet of template code to get the actual URL:

CODE/mt/archives/<$MTEntryDate format="%Y/%m"$>/<$MTEntryBasename$>.php

As your Wordpress links currently are, you'd need to use the following snippet of code to generate a dummy Wordpress URL:

CODEhttp://www.chroniker.net/blog/?p=nn

After you've generated the list of redirects, you'd have to look up the Wordpress entry ID numbers and replace the "nn" in each directive with the correct Wordpress entry ID number.

 

The full code to generate the redirects would look like this:

CODE<MTEntries lastn="999999">

Redirect Permanent /mt/archives/<$MTEntryDate format="%Y/%m"$>/<$MTEntryBasename$>.php http://www.chroniker.net/blog/?p=nn

</MTEntries>

Now I don't use Wordpress, but I read somewhere that you could change the format of your permalinks to use the entry title instead of the entry ID number if you wished. Both Matt's code, and Alex's templates, assume your Wordpress installation is indeed using permalinks in the format of /blog/archives/yyyy/mm/dd/entry-title/, and if you're not, you have to edit the code for the actual format of your links (like I did above with Matt's code).

Bruce,

 

Are you suggesting I do this instead of David's reccomendation, or after?

 

Go in to the Options panel of WordPress and select Permalinks. I use the default ones it suggests. Just copy and paste the code into your .htaccess file.

Share this post


Link to post
Share on other sites

I'm not sure what I suggested will help you out. You are trying to make your WP links match your MT links and I think David has you on the right track.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...