Recently decided to transfer Mt background data from Berkeley file db to MySQL. One reason is that using a relational database gives you more flexibility, such as running a SQL to change one of the properties of all entry; Another reason is to familiarize yourself with this database in advance, the dental Web site uses a virtual host, the database provided by DreamHost is MySQL, and I used to The main use of SQL Server,oracle and Db2,postgresql also only understand a little, and MySQL is almost no contact.
The 5.0.27 installation file was downloaded, the installation was successful, and the database character set of the first default port 3306,utf-8 was used.
Installation completed, run the command line client, input help, give the instructions are not many, also did not see the database to create the command, then checked the installation of the Help file, the organization is not bad, very complete, quickly find the relevant command:
View existing database show databases; Connect database testuse test; CREATE DATABASE Mtcreate db MT; and then find a way to convert an existing one to MySQL, Soon found a third-party tool mt-db-convert.cgi, which enables transformations between several different DB implementations of MT support.
Download back into the Cgi-bin Mt directory, run in browser access, enter the newly created MySQL database name MT, username root, password, host fill in localhost, start convert. The conversion process is completed quickly, less than 1 minutes, no error prompts, and the conversion information is as follows:
MT-DB-CONVERT.CGI ($Rev: 173 $): Converting your MT data between DB engines (for MT 3.2) Loading database schema ... Loading data ... Mt::author. (1 objects saved.) Mt::blog.. (2 objects saved.) Mt::trackback .............
(327 objects saved.) Mt::category .............
(Objects saved.) Mt::comment.. (2 objects saved.) Mt::entry .................... ...
(514 objects saved.) Mt::ipbanlist (0 objects saved.) Mt::log ..... ...... ...... ..... ...... ....... ...... ....... ...
(437 objects saved.) Mt::notification (0 objects saved.) MT::P ermission ....
(4 objects saved.) MT::P lacement ........... ...................
(527 objects saved.) Mt::template ..... ....... ...... ........ ........ ...
(Objects saved.) Mt::templatemap ..... (Objects saved.) Mt::tbping (0 objects saved.) Mt::session ................ ......
(Objects saved.) MT::P lugindata (0 objects saved.) Mt::config. (1 objects saved.) Mt::fileinfo (0 objects saved.) Done copying data from DBM to dbi::mysql! All went. Your Recommended Setting-------------------------------------
# r:/site/mt-db Objectdriver dbi::mysql Database mt dbuser root dbhost localhost dbpassword comein------------DataSource -------------------------
Then modify the mt-config.cgi file and change the data source to MySQL.
Visit Mt again, everything seems normal, even the original session did not throw away, only the data used in the background has changed position.
But found the Chinese garbled problem, Google to this method, according to the text modified, need to perform mt-db-convert.cgi again, the data into MySQL, and then visit MT, garbled no, all Chinese display normal.
After the conversion, a new problem was found, tags in the original db were all lost, because mt-db-convert.cgi only supports the data changes brought by the new features of Mt 3.1,3.3 may also have other information lost.
Note
This script is compatible with movable Type version 3.1x. I didn ' t test it at no other versions.
In fact MT itself has provided the conversion tool mt-db2sql.cgi, with mt.cgi in the same directory. The use of the method is to install the MySQL database service, and create a good for MT DB, the MySQL database configuration information into the mt-config.cgi, while retaining the original Berkeley DB path configuration, that is, to maintain the two DB configuration at the same time effective, Then run mt-db2sql.cgi through the browser, the conversion will start automatically, displaying the following information:
Loading Database Schema ... Loading data ... Mt::author 1mt::blog 1 3mt::trackback ... Done copying data from Berkeley DB to your SQL database! All went well. After confirming the successful conversion, modify the mt-config.cgi and comment out the configuration of Berkeley Db.