Moving from another CMS
From e107 Wiki
e107 Wiki: English | Русский | Deutsch | Français | Magyar | Português | Български | Česky | Nederlands | Ελληνικά | Italiano | Norske | Polska | Slovenščina | Español | Svenska | Translate: Wiki | Page
English | Magyar This page is a stub. You can help e107 by expanding it.
Migration from another CMSIt is possible to import existing data from another CMS (providing it uses MySQL) into a fresh install of e107. Some scripts are available; the level of imported data varying from system to system. You are advised to try them on a test system first. In general, the scripts will empty your existing database. It is also sometimes possible to transfer user information into E107 with MySQL queries - this should be possible with any source database which provides a login name and md5-encoded password.
Summary of import capabilities
** - See notes below. To run an Import ScriptThe "standard" scripts are in the subdirectory e107_files/import To run a script, log into your e107 site, then go to the script page: yoursite/e107_dir/e107_files/import/scriptname Where 'yoursite' is the full URL of your site, and scriptname is the name of the script you wish to run; for example: phpbb2.php mambo.php Notes on specific CMSPHPBBThere is a script available which can import most of the information. The latest version also imports bbcodes, including changing the format of certain codes to be e107 compatible. By editing tables it is possible to selectively translate one bbcode into another, force lower case on BBCodes and other operations. BBCodes which have no direct equivalent within e107 can be deleted, or mapped to another code. Alternatively additional bbcodes can be created to provide support for these codes (note that bbcode handling changed between 0.7.5 and 0.7.6, and if not automatically installed, the plugin scanner can pick them up). The script included with E107 version 0.7.6 or later should be used - earlier versions were incomplete. PHPNukeStatus of included script unknown
Mambo/JoomlaJoomla is a derivative of Mambo, and appears to have the same database format. Thus the same import script should work for both. The current script imports users only. Not confirmed as to whether the script works with latest editions of Mambo/Joomla Migration ReadMePHPBB2 to E107 Conversion RoutineIssue dated: 13.06.2006 Any updates, bugfixes or comments please send pm to steved at e107.org Conversion routines from other BBSphpbb2.php - modified from earlier script, with ability to process and re-map bbcodes, plus more options. Note: Only the underlying read/translate routine has been modified, plus some detail changes in the configuration table. The key routines which read and write the databases should be the same as those originally shipped. Credits: Based on the script originally shipped with E107 (jalist) Modified to mostly work by aidee Enhanced by steved Reflects mods made by McFly in the "official" script between V1.4 and V1.5 Thanks to Rashan for a lot of testing and feedback.
Installation1. Create a fresh install of E107. (Not essential, but it will overwrite rather a lot!) 2. Copy the files into the e107_files/convert subdirectory.
To Run
db to import FROM is your phpbb2 database, with whatever prefix is set - often _phpbb_
Known Issues
BBCodesBBCode conversion may not always appear to work completely, especially if they were originally not been entered correctly. And there may be bbcodes which are not supported in E107. In some cases it is possible to do a direct translation within the conversion routine (see later). Otherwise download the add_bbcodes plugin from e107coders.org, and create bbcodes to match the originals (its often possible to use an existing bbcode as a template). MODIFYING THE BEHAVIOURFile import routine (import_mapper.php)The import is based on a processing routine whose behaviour is defined in an array. The rest of these notes deal with that routine. Using the tables in the accompanying file as an example, it should be possible to modify the behavior of the conversion, and adapt to other CMS. Using the conversion routineRead one line from your database; pass to: function createQuery($convertArray, $dataArray, $table, $maptable default null) where: $convertArray is an array defining the translations and lookups to be done $dataArray is an array of input data, keyed by source field name. $table is the table name $maptable if specified is used to translate bbcodes. The function returns a line of text which is a mySQL 'INSERT' query. $convertArray formatThis is a 2-dimensional array which relates fields in the source and destination databases. Each row has a number of definition fields which relate to a single data item. The first three are mandatory. The keys must be as specified: Field 1 "srcdata" Source field name Field 2 "e107" Destination field name Field 3 "type" Type of destination field: INT - Integer STRING - Text/string of any sort STRTOTIME - time/date as text string (not yet supported) Field 4 "value" (Not always present - should only be if source field is null) Sets a value (sometimes from a function parameter). Overrides all other options. Field 5 "default" Sets default if the source field is undefined Field 6 "sproc" Various processing options (see below)
Processing OptionsComma separated string of processing options; options are invoked if present. The following are applied to string fields: usebb Allows bbcode, and enables other bbcode processing options. If the $maptable parameter is non-null, translates bbcodes as well phpbb Causes numerics after colons within bbcodes to be stripped bblower All bbcodes are converted to lower case. (Applied before other processing) stripbb Strips all bbcode in a string (i.e. anything between []) The following are applied to integer fields: zeronull If the integer value is zero, writes a null string.
BBCode Mapping TableA mapping table may be passed to the conversion routine, which translates bbcode between the two systems. The table is an array of key/data pairs, for example: $mapdata = array("b" => "bold","u" => "ul");
The above translates the 'b' bbcode to 'bold', and the 'u' bbcode to 'ul'. It is also possible to delete a specific bbcode (while retaining the text between the start and end of the code) by setting the translated value to an empty string. The above method can also be used to translate bbcodes from upper to lower case. Parameters after the bbcode (identified as following an '=') are retained; Base routines read one record at a time from the source database, and pass it to createQuery, which uses the above tables to generate an 'insert' line with the appropriate data. See Also | ||||||||||||||||||||||||||||||||||||||||||||||||

