Wordpress - Best way to import users, post and categories from an external database

Unless there is a core Wordpress import filter available for your CMS ( see http://codex.wordpress.org/Importing_Content ) or a plugin for a CMS not covered by core WP ( see http://wordpress.org/extend/plugins/search.php?q=import ), or a Google search for your database schema doesn't reveal anything, you need to roll your own importer.

The best way is to write a MySQL query that will take your current data and move it into the Wordpress database structure. That can be complex, but in the end, it's the most efficient and accurate method.

But you can also try exporting from the database using phpmyadmin into CSV and then working with that file with Excel or text editors to get the content into the correct Wordpress table schema and import that CSV with phpmyadmin ( see http://codex.wordpress.org/Database_Description or try a CSV import plugin http://wordpress.org/extend/plugins/search.php?q=import+CSV ). That's obviously less MySQL intensive, if you're not that great with queries.

Or you can try building and then importing a WXR file, WP's special import format used for moving content between Wordpress installs. Export a few posts and pages from a test Wordpress site to get a sample WXR file to determine the format ( see http://codex.wordpress.org/Tools_Export_Screen ). And then take a text export of your database and "massage" it into a WXR file.

Another idea is to set up an RSS feed for your site and import that way; see http://codex.wordpress.org/Importing_Content#Importing_from_an_RSS_feed But that won't get users or categories, only posts.