Migrating MovableType to WordPress

This is a migration guide I wrote solely for the benefit of myself. Although I don’t think I need it the second time, to have a detailed reproduce steps written and modify to reflect the actual steps are the basic skills of a support engineer (by training).

The Problems

The basic export/import stuff works for MovableType to WordPress – pretty straight forward. There are only three minor issues that prevent the smooth transition.

Problems 1: URL change.

My MovableType uses a naming system I created, not the default. The Individual Entry Archive page URL was:

<$MTArchiveDate format=”%Y%m%d”$>_<$MTEntryTitle dirify=”1″$>.htm

After exporting, the URL is renamed by the base name of the MovableType, not the full name. For example, URL:

http://home.wangjianshuo.com/archives /20060127_long_vacation_of_spring_festival_comes.htm

becomes

http://home.wangjianshuo.com/archives/ 20060127_long_vacation.htm

The solution:

Unlike most of the solutions found on Internet, I am going to change the base_name in the Export file itself. I will change the MTOS-4.38-en/lib/MT/ImportExport.pm file. I am going to change the line

BASENAME:<$MTEntryTitle dirify=”1″$>

to

BASENAME: <$MTArchiveDate format=”%Y%m%d”$>_<$MTEntryTitle dirify=”1″$>

This should solve the problem to let WordPress know the right way to preserve the URLs.

Dash Problem

This solve the old post problem that was imported from MovableType. For the new post, the problem is with the “-“. WordPress uses dash instead of underscore to replace non-alphabetic characters. I just need to go to wp-includes/formatting.phpfile and change all the dash, to underscore in the function sanitize_title_with_dash. This solve the future post problem to make it consistent with the older posts.

Update July 25, 2012

Be sure to comment out the following line:

preg_replace(‘|-+|’, ‘_’, $title);

Because WordPress just leave – as it is, and replace it to underscore causes many previous articles broken.

Problem 2: Encoding difference

The default encoding of MovableType was ISO 8859-1, and WordPress uses “UTF-8” (right choice). The steps in the migration plan solved the problem. Otherwise, the problem I met was, the content after the special character, like ASCII code 92 was cut off, which is a necessary replacement of a single quote ‘.

WordPress uses UTF-8 as the default encoding. So if your MT blog uses ISO 8859-1 or Latin – 1 to encode posts, convert the posts to UTF-8 before importing, to ensure that all characters display properly.

On *nix and OSX you can use the iconv program to convert your import.txt file: $ iconv -f ISO-8859-1 -t UTF-8 import.txt > import_new.txt

After I did the conversation, I went on for the extra mile to use the following command in vim to change all the annoying encoding x92, x93, x95 to its proper format:

:%s/[|]/’/g (119, and 1623 replaced)

:%s/[|]/”/g (979 and 897 replaced)

:%s//o /g (334 replaced)

:%s/[|]/-/g (323 and 264 replaced)

If the original MT uses UTF-8, it won’t be a problem, although the exported file is not directly readable in editor in Mac.

Problem 3: Convert Line Breaks

By default, when I use two lines to separate a paragraph, but in WordPress, it becomes a single line and the two paragraphs are put together with only one line break.

It turned out the bug 16147 is exactly talking about the problem and fixed the problem. Just go to the importer.php file and remove the following line.

 (if( !empty($line) ))

Something to note is, since WordPress load plugins automatically, /wp-content/plugins/movabletype-importer/movabletype-importer.php does not exist in the downloaded package.

Problem 4: The Chinese Title

Using the sanitised title as part of URL is good to keep it unique, but the Chinese title causes problems. You cannot just use the Chinese encoded names as WordPress, resulting huge number of % and numbers in the URL. The original less of consideration of MovableType actual worked very well by just taking some a or e out of the encoded title, but need some research.

Configuration

After migration, there are some configuration work. Basically by looking at the admin tab one by one, we can get some idea. Here are some outline:

1. Configure the upload file folder.

2. The URL slug – use %year%%monthnum%%day%_%post_name%.htm

3. Open XML-RPC

4. Change display name for default user.

Done

That should be all I have to do. Did some quick research and quickly fixed the problem. I am going to do the actual migration the next weekend. Then you will see a brand new blog.

Thinking about Switching to WordPress

I am a one with emotions. I have been using MovableType for almost 10 years – daily. There are many great memories with MovableType. I know their founders (well, met briefly during my first Silicon Valley trip), and I know many of their people (well, early employees, not sure if they are still there). They even hosted a 6 year blogging anniversary for me in their office. I am using MovableType daily for so long. To be short, I loved MovableType, and the team.

However, recently I really got pissed off by the slowness of MovableType and its almost stopping on development. There are still bug fixes, but it is not interesting. In a Saturday morning, I started to think, shall I still stay on MovableType?

My whole 10 years of daily blogging started with a post named: MovableType Successfully Installed on Windows XP. I didn’t expect the 10 year journey started there. Today, I had the idea to install WordPress, and give it a try (with a little bit sense of guilty deep in my heart). It turned out that the installation went well, and it did complete in 5 minutes.

I am going to test run on this blog for a while, and decide whether I want to migrate the site to WordPress. That may be another journey. I’d like to take the chance to thank MovableType team, for allowing me to use the software for so long and to spend thousands of hours on it, to create something I am proud of after many years.

P.S. This post was posted on WordPress first, and copied here.

Over Optimistic and Over Pessimistic

Based on my observation on the International companies in China, which failed, or failing, they are swinging from the over optimistic mode to over pessimistic mode. eBay is an example, and Google is another.

They start with big ambition to get the whole country in few months, or 1 year, but it quickly find out that it is mission impossible and then they quickly switch to the over pessimistic mode and claim the failure. They are actually not.

What they need is neither of the two – they just need to be realistic.

New Traditional Industry Leaders Meetup

This is an interesting gathering – a group of CEOs of Internet companies in Shanghai agreed to meet quarterly. We joked the industry has become a new “traditional industry”, because it has been labor intensive, unlike the traditional internet business model.

Here is the final photo:

From the left to right are:

Afu, CEO of JJDD.com

Zhang Tao, CEO of Dianping.com

Bill Yao, CEO of PPTV.com

Mike Liang, CEO of Anjuke.com

Jian Shuo Wang, CEO of Baixing.com

It is good to catch up, always.

Drawing

As expected, people don’t come promptly, so I used the time to draw the corner of the room.

IMG_9001

The Question to Ask on Dinner Party

Check out Auren Hoffman’s blog post: TPQ – Thought Provoking Questions. This answered the question about “The Awkwardness of Meeting Someone in Person” I mentioned yesterday in this post. It is the lack of a good question.

Dr. Andreas Weigend’s TPQ was, “What was your biggest surprise in the last year?”

I got another one, it is asked by Adams Lashinsky: “How you can make big money in the next 20 years?”

The Top of Paul Graham’s List

A short quote from Paul Graham’s to do list in this article The Top of My Todo List:

Don’t ignore your dreams; don’t work too much; say what you think; cultivate friendships; be happy.

Paul continued to be the most amazing writers that I read – he have some genuine thoughts, and guide him and many of his startups. I would highly recommend you to read his blog.

The Awkwardness of Meeting Someone in Person

In one book, Alan De Botton mentioned that reading is better than talking because it allows pause, and deep thoughts, and more well structured thoughts. You cannot fall into deep thoughts when you are at the conversation with your favorite author. Just as echoed in this article: Writing and Speaking, talking is not the best way for intelligent and thoughtful people to exchange ideas. I can imagine I have not too many things to talk about if I meet with Alan de Botton, or Paul Graham one day.

I had a conversation with Yu Ying, the famous doctor in Beijing who write micro-blog – a weibo with 800,000 followers. Her Weibo is interesting, and her talk on TnDao was great. But to when to bar with and chat, it is hard to calm down and really talk. That is the awkwardness to meet someone in person.

World Financial Center

The most interesting in Shanghai is maybe the 52th floor of the World Financial Center in Pudong. I visited the tower today because I had too meetings in the same building. People need to transfer to another elevator at the 52 and 53th floor. If you are someone who likes to climb to tall buildings, you can get to the 52th floor lobby without having to making any appointment with people working there. Below is the photo of the lobby.

IMG_8998

Over the window, you can see the new Shanghai Tower is in good shape already.

IMG_8997

TnDao, Shanghai’s TED

I attended the TnDao forum. It was great.

TnDao forum was inspired by TED, and was initiated by Mr. Dai Jianbiao and many other great people like Miss Jian Fang, and Mr. Jian Changjian. It is a monthly talk of great people and offers an opportunity for few hundreds people to escape from their busy lives to get inspired by new ideas, especially from different industries.

You can get more information and the past video from http://tndao.com.

It is free to attend, but you have to register on the website when it opens to registration. The next time should be around the early of June. I am invited to talk on the forum but I don’t have any idea what to talk yet, so likely to skip.

Longjing is My Favorite Village

“40-year-old is the time to form one’s value system”, He Ying meant it when we had coffee tonight, after I am back from Hangzhou (the fourth consecutive weekend).

The mountain area of Hangzhou is very good place for exercise, to drink, eat, to stay and to think. Among the villages, I love Longjing 龙井, Manjuelong 满觉陇 and Yangmeiling 杨梅岭 most. I climbed the mountains, and drinker the tea, and rate it as my favorite village in China. (Well, this is a very biased view, since I only visited very few of them. But anyone has the right to do the rating anyway, right?)

Here are some photos from the trip:

Above is the picture I drew at Longjing.

The Jiuxi (Nine Creeks) area:

Going to Hangzhou Again

After being in Hangzhou for three consecutive weekend, I decided to go to Hangzhou again, today, with Wendy and Yifan.

This is an action to break the laziness and make some difference in the normal life.

IF, I mean everyone can imagine the IF part, we set our home in Hangzhou, and we will commute to Hangzhou every weekend. I know many people, at least 10 of them, have their home in a different city and they have to do the same thing as we do today, for years. Many of them have homes in Shanghai but work in Beijing or Shenzhen, or Hangzhou.

IF, we can sometimes understand others life, some strange behavior started to be normal. Thinking is the process to make those abnormal to normal.

Shanghai Real Estates Still Under Control

The Chinese government always have more methods to control whatever they want to control. They can control how many child you are allowed to have, and it is not surprising to see how many houses you can buy.

According to the House Purchase Restriction order:

  1. For local residents who already have one apartment, and non-local residents who have been paying tax for two years, they can only purchase another one.
  2. For local residents with two or more apartments, or non-local residents with one or more apartments, they are not allowed to buy any houses/apartments.
  3. For anyone who buy second apartment, the down payment have to be as high as 60%, and the interest rate has to be 10% higher than average.
  4. Tax for transfer of houses purchased less than 5 years are significantly higher.

There are many other restrictions. These are the powerful rules to keep buyers out of the market, and the house market kept flat and down ever since.

 

7 Year Anniversary of Baixing

It is an exciting day. Looking back of the 7 years, I cannot imagine how I can be luckier to have a group of really talented, committed, and passionate friends to work on this. 7 years is not a short period of time. That is almost 1/7 of one’s entire working life. This group of people stayed with each other, hand in hand, and marching forward – to change the world.

Planning Ahead Ended with Packed Days

I am planning ahead and started to put appointment one or two weeks ahead of time. Some of the meeting appointment is even a quarter away.

This practice ended up with very packed day. In the last few days, my schedule is like a meeting every two hours or one hour. I actually had 5 meetings today.

The upside of this type of scheduling is, it put the most important things on the calendar first, and you make sure you the important things done first, instead of urgent one.

Glad to share.

Connect with People We Know

Here is the challenge. Just as scaling the organization, as I grew, well, to 30-some, the relationship network I accumulate over the last 20 years started to reach a scale that is hard to manage the old way. Maybe that is the reason why time flies faster and faster. Think of Yifan – he only has about 10 person relationship he needs to manage right now (at the age of 4, parents, grandparents, teachers, and a girl-friend). I have at least 1000 people in my address book that I had once kept pretty close relationship along the way.

Stay with the Past

Although it is so nature that when we move on, the old relationships fade out from the horizon. High-school classmates, past colleges of old companies. There is actually not too many reasons to re-union, but the past is always what defines us today, and science research shows staying with the past makes us happier.

Communication

Communication won’t happen automatically, unless you design it to happen. I have friends who hang up photos of his friends. It is a good way to remind people of the persons they care about. Out of sight, out of mind. If there is a way to keep people in sight, it is easier to keep them in mind, and makes the connection easier.

Electronic Tools

There are Facebook or other tools, but they are not helpful if the person is out of mind. I have to say the most impressive offline event I saw was Carroll’s tree trimming party. There is friend who comes to the party in the last 43 years! A tradition like that will greatly help to keep people connected.

Big Surprise: How Much Apple Product I Bought

One of the biggest surprise in 2011 was how many Apple product I bought. I had never imagined that before. Here is a list:

1. iMac as the main desktop computer in our reading room.

2. MacBook Air 13′ as my main laptop.

3. MacBook Air 11′ as Wendy’s main laptop

4. iPhone 4 for my main phone

5. iPhone 4 for Wendy’s main phone

6. iPad first generation for me

7. iPad 2 for Wendy

8. Time Capsule as main wireless router, and main NAS

Apple has a much higher revenue / employee in IT industry.

P.S. Corrected my typo – should be MacBook Air, not Pro.

P.S.2 Another surprise. I now have Apple friends, and have many friends joining Apple, in Beijing and Shanghai.

Scaling An Organization

I love technology, and enjoy scaling a system. You build the right architecture to allow scale out – using more computers to provide more processing power.

Talking about a company, we have to scale it as well. It is an art of scaling a human organization. To make a scalable system work for the people is much more complicated than in technical world.

When an organization grows, easy things started to become difficult. In technical world, insert a record into a database, serving a page view – any newly-graduate computer major can do the job. Inserting 1 million record per minute into the database, or serving 1 billion page views per day? Not easy. For the organization, it is the same. Communication within 1 0 person team is very different from 100 person team.

Communication needs to pay basically no attention when the team is small. Everyone knows everything – just like the husband/wife relationship. There will be no meetings, or PPTs – everyone just know.

It adds a lot of overhead as the organization gets bigger. This process seems to be irreversible, but need to be as slow as possible.

The key is communication. I just learnt it is exactly like the seat table. I paid great attention about who seats near whom, but not as closely as to the organization. We change seats every quarter to allow optimization communication. The same should happen to organization design.

To organize the team around functions or business are the key questions. We need to switch and alternate it every quarter to get the least of evils from any organization design.

The communication needs to be well planned, and enforced. We need to do it all the time, and that is the over head. We need to add a communication bus for the company to allow messages to flow within the company.

Network Infrastructure in My Home – After 10 Years

I wrote an article about 10 years ago (on September 13, 2002) named:

Network Infrastructure in my Home in Shanghai

Time flies. So many things changed since I wrote that blog ten years ago.

  • I was at age of 25 at that time, and now I am 35
  • At that time, I was an engineer at Microsoft who likes and good at writing technical articles like Knowledge Base Articles. Now, I am an entrepreneur who only cares about the network to be working than anything else.
  • At that time, Dial-up was still an option (Just dial 8163 for Internet?) and now it is not.
  • At that time, The Great Wall Broad Network was still an option, and now it consolidates to just China Telecom, and few similar.
  • At that time, broadband just started. The first paragraph of my old article reads: “For friends in Shanghai, they are curious about the broadband, which is new to the city.”
  • At that time, I only have one client device – a desktop PC – connecting to the Internet. Now, I have a dozen. (While, that PC is famous because it is in my reading room, and accessible from the Internet via http://home.wangjianshuo.com, the domain I later migrated to hosting companies).

So, let me take time to examine the current network infrastructure of my current home – Wendy complained for Internet access many times, and I finally get it to a level that is stable enough to Wendy’s satisfaction.

Broadband Provider - Fiber To The Home (FTTH)

In the recent upgrade, the China Telecom Shanghai changed ADSL in my home to the current FTTB. There is a optical fiber cable at the door of my home, connected with a fiber modem. I pay 150 RMB per month for the 10M speed.

Here is the IP information from APNIC

% APNIC found the following authoritative answer from: whois.apnic.net

% [whois.apnic.net node-5]

% Whois data copyright terms http://www.apnic.net/db/dbcopyright.html

inetnum: 101.224.0.0 – 101.231.255.255

netname: CHINANET-SH

descr: CHINANET SHANGHAI PROVINCE NETWORK

descr: China Telecom

descr: No.31,jingrong street

descr: Beijing 100032

country: CN

admin-c: WWQ4-AP

tech-c: WWQ4-AP

status: ALLOCATED PORTABLE

notify: ip-admin@mail.online.sh.cn

remarks: service provider

mnt-by: APNIC-HM

mnt-lower: MAINT-CHINANET-SH

mnt-routes: MAINT-CHINANET-SH

mnt-irt: IRT-CHINANET-CN

changed: hm-changed@apnic.net 20110103

source: APNIC

It seems the IP address is a stable number since it is always connected there. (I started to miss the time when we were using 202.120.xxx.xxx IP address in universities.)

The Shanghai Bell equipment of RG201O-CA is a very simple modem plus a gateway to the outside world of my entire home.

Three Routers

To cover the entire home, I needed three routers. Due to being stupid and too optimistic about the performance of WIFI, I only have limited ethernet cable on the two floors of the home. So I setup it this way:

Router 1: 192.168.2.1 TP-Link WR320R to provides wireless to the first floor.

Router 2: 192.168.1.103 Apple Time Capsule 2T to provide wireless for the reading room

Router 3: 192.168.1.253 TP-Link WR700R to act as a repeater to extend the wireless network of Apple Time Capsule to provide additional coverage for other areas of the house.

WIFI/Ethernet Clients

Obviously, we have much more clients than before to connects to all these wireless and wired networks. Here is an incomplete list:

  • iPhone of Wendy(0C-74-C2-A5-C0-A5)
  • iPhone (18-E7-F4-F6-4A-45)
  • iPad 2 (40-30-04-9A-C3-80)
  • iPad 1 (D8-A2-5E-3D-96-29)
  • iMac (e4-ce-8f-5f-6d-89)
  • MacBook Air (04-0C-CE-D4-0F-52)
  • Sonos Hi-Fi System (00-0E-58-72-39-AE)
  • TCL TV

Obviously, there are much more clients than before, and the count is going up every month.

It is a much more fancy network than many years ago with NAS (Network Area Storage) and other equipments connected to it.

What is CEO’s Job

What a CEO should do? I have to recommend an article from Ben Horowitz again (the second time in a week): How Andreessen Horowitz Evaluates CEOs.

Here is some note I took away from the reading. You should definitely read it too, by yourself.

According to Ben, he thinks the CEOs should do two things:

  • Does the CEO know what to do?
  • Can the CEO get the company do what he knows?

This is very broad and “empty” statement at the first glance, but Ben explained it in a very good way.

First one

About the first one, “Does the CEO knows what to do?”, Ben suggested “One should interpret this question as broadly as possible”. Basically, it is like: CEO needs to know everything. Don’t laugh. It is actually very true. The CEO has to have insights of many things, from the office arrangement, to hiring, to marketing, to technology, to finance. Knowing what to do is about consistently keeping thinking about what’s behind the surface. It is tough, but … exciting.

In particular, the story – the question “Why”…

The other interesting part about know what to do is to make decisions. What Ben contributed in this idea is to clearly point out that CEO needs to make decisions with very limited information, always! The expectation to understand more about it is just not realistic. That actually gave me great relief about the situation I am in.

Second One

The second one is about getting the company do what he knows.

It turned out to be organizational capacity, get things done culture, quality of hiring, and the work environment. It is not surprising that Ben mentioned the Netflix culture building slides.

For Baixing, as a company with 50+ full time employees, we tried very hard to build a great company, and with great result. We are trying so hard to make sure the people are the core of the organization, and build the culture to help people to perform within it. It takes years of experience to get it…