Free at last – Migrating from XOOPS
[lang_en]the reasons
When our website was created in late 2005, we based everything on the XOOPS Content Management System, because it was easy to setup and even easier to maintain. Everything in XOOPS is modular and customizable – although the template and theme editing is a real pain in the ass. Now, 17 months later, XOOPS has turned out to be kind of asleep – it is not updated anymore and the modules we used (XPress, DokuWiki) are outdated and really buggy. Our RSS Feeds were broken, the XOOPS User Management did not allow Members to post news on the XPress module without having full admin rights, and the whole system seemed kind of slow and klutzy.
It had been our plan to move to another CMS, like Drupal, or decentralize the whole shebang to WordPress and DokuWiki. We kept delaying the project over and over, because PHP hacking and nerve-killing MySQL mayhem were not really the activities we were looking forward to.
Now – finally – we did it!!! And it works almost perfectly. We didn’t lose any crucial data and the database has not become a cryptic byte chaos. If you are planning to achieve a similar task – migrating from XOOPS to WordPress and/or DokuWiki, here’s a short summard of the most important tasks.
the plan
We really wanted to kick XOOPS off our server, but keep the whole WordPress (XPress) and DokuWiki part, and not lose any of the user logins and passwords. Still on our wishlist is a working solution to use the WordPress user database and management as authentication for DokuWiki, because having only one login session for all is just more elegant…
the liberation
The FTP directories and MySQL Structure have become a total mess in the last months due to experiments with CMS systems and failed tweaks and hacks, so in order to achieve the decentralization successfully, everything had to be cleaned up. The whole root directory with all the XOOPS chaos was moved into a backup folder. Then, the latest DokuWiki was installed in /wiki and WordPress 2.2 was installed in the document root folder.
After the successfull installation, mySQLAdmin was used to explore the databases for all the important data to be migrated. First of all, the XPress pages, posts and categories had to be moved over, so all the xoops_wp_posts and xoops_wp_categories tables were simply renamed to wp_posts and wp_categories. The XPress XOOPS Module was a WordPress 2.0 hack, and a feeling of fear and loathing dawned when the newly installed WordPress simply didn’t show ANY posts in the Manage tab. Comparing the WordPress 2.0 and 2.2 wp_posts tables, you realize, that post and pages management has changed. In the old system, the post_status field was used with published and static to differentiate. Since WordPress 2.1 there is now a field called post_type with post and page. So with a few SQL commands or with MySQLAdmin it’s fairly easy to change those. Finally all posts showed up.
The next thing that had to be done was transferring all the user logins and passwords from the XOOPS Database to the WP User Database, which could be achieved with the following SQL command:
INSERT INTO wp_users (ID, user_login, user_pass, user_nicename,
user_email, display_name)
SELECT uid, loginname, pass, uname, email, uname
FROM xoops_users
WHERE uid > 1;
The UID 1 had to be skipped, because the admin user in WP has this number. Unfortunately, the user_registered field had to be skipped and thus automatically filled with zeros, because the registration date of the xoops users could not be easily found and actually quite unimportant.
All the rest was done within the WordPress management backend, like Plugin reinstallation, fucked up characters within the posts were fixed, etc.
wikiwiki
DokuWiki stores all its informations and data in a flatfile database within its folder data/pages. Since XOOPS handled all this stuff, this data was hidden inside the uploads/dokuwiki folder and manually copied to the /wiki/data/pages folder of the newly installed DokuWiki. The user database is also stored in a file at /wiki/conf/users.auth.php. There is a php script that is supposed to handle DokuWiki authentication with the WordPress database, but it is written for older versions of DokuWiki and WP, and a new version could not be found – hopefully we will be able to implement this feature in the future.
The users.auth.php file looks like this:
user:MD5password:Real Name:email:groups,comma,seperated
So all the user data from our wordpress database had to be copied into this file. The needed data was simply collected with the following SQL command:
SELECT user_login, user_pass, user_nicename, user_email
FROM wp_users;
The data output from this command was then exported to a CVS textfile, fields separated with ‚:‘ and without any line break symbols. The content of this textfile was then inserted into the users.auth.php file, and ‚:users‘ was appended, so all users became members of the user group within DokuWiki. The user names at the beginning of each line were converted into lowercase, because DokuWiki did not authenticate any uppercase logins for some reason.
Everything works quite well now, a lot faster than with XOOPS backend and the only things we lost, were the registration dates of all users, the discussion comments and the Recent Changes log in DokuWiki – so all in al, the migration/liberation/conversion was really successful.
Since the page has been up for quite a while, users and crawlsers and rss engines have probably already bookmarked some of our links…they used to be /modules/wordpress/ and now they are just in the root folder…so at the and we added the following lines to the .htaccess file to redirect everyone who accidentally drops into the /modules/wordpress folder back to root.
<IfModule mod_alias.c>
Redirect /modules/wordpress http://www.visualberlin.org
Redirect /modules/dokuwiki http://www.visualberlin.org/wiki
</IfModule>
That’s it! Enjoy our new pages…
[/lang_en]