▄▄             ▄▄▄  ▄▄▄ Power
█  █ ▄▄▄▄ ▄▄▄▄▄ █  █ █  █
█▄▄█ █▄▄▄ █ █ █ █▀▀▄ █▀▀▄
█  █ ▄▄▄█ █ █ █ █▄▄▀ █▄▄▀

Login
Register
/ aa about.it ad amd64 and.who api asm asmbb asmbb.features authentication bbcode best bugs cares chat common debian deck design dll docker email embed fast feature files fossil fresh.ide friendly gamedev heap help hiawatha i18n incredible interop learning libfresh limit links linux mailing.list meme meta.http-equiv minimag money mysql neo nginx numbers orly os outage pass password post-by-email programmers programming proile read-by-email resources safety script.alert.xss secret seo skins sodom source sourcecode subdirectory subforum support tags templates test test123 type very.ugly video work xss игнат котики парола русский тест уеб.програмиране хабр.наполеон
Categories Threads

The first attempt to convert phpBB database to AsmBB RSS

Here is described the first, not finished, semi-automatic method to convert the phpBB database to AsmBB.

Here are the steps:

  1. Dump the mysql database to SQL dump.

  2. Separate the CREATE and INSERT statements in two different .sql files. Remove all other code from the dump. We will not need the indices, triggers and so on.

  3. Convert the file with the database schema (the create statements) into SQLite format. There are some tools available (I will attach some in the post) but they does not work very good. I will attach as well the schema file from the version of phpBB I converted ( phpbb_schema.sql ).

  4. Convert the data dump (insert statements) into SQLite format. Actually for MySQL only the string constants need to be converted, because it uses C style character escapes, but not SQLite. I have written special tool (attached mysql2sqlite.tag.gz ) in order to convert the strings, because the available was not able to make it. The program reads from STDIN and writes to STDOUT. For example:

  5. cat phpbb_insert.sql | ./mysql2sqlite > insert.sql
  6. Run so prepared dump files with the console version of sqlite in order to create SQLite database with the structure and data of the converted forum. Something like:

  7. sqlite3 phpbb.sqlite < ./phpbb_schema.sql sqlite3 phpbb.sqlite < ./insert.sql
  8. The next step is to put the attachments into the database (because phpBB stores them as a files. Execute the script attachments.sql against the database. But first check the paths used inside. In my case, the files are located in ./php_engine/files/ directory.

  9. sqlite3 phpbb.sqlite < attachments.sql

    After this step we have an SQLite database phpbb.sqlite with the structure and data of the original phpBB forum.

  10. Install locally AsmBB and run it in order to create new empty AsmBB forum. Create an admin user with name that not exists in the phpBB forum.

  11. put the created phpbb.sqlite database in the same directory where AsmBB is installed.

  12. Open the local AsmBB in a web browser, login as an Admin and open the SQLite console. You must use the SQLite console for the following processing, because AsmBB uses some user SQLite functions that are not available in the other SQLite tools.

  13. Copy the text from the file phpbb.sql into the SQL window and execute it - it should import all data from the phpBB database into the AsmBB database. Check carefully the result messages in order to detect execution errors. It is a good idea to first make a copy of the initial empty AsmBB database in order to have an easy way to undo.

Notice: The script converts the phpBB private messages into an AsmBB "Limited Access Threads" (LAT) but because of the very nature of the private messages, the result is not very good. I am working on a way to make this conversion in a more natural way, but with little success so far.

All the mentioned above files are attached to this post:

Attached files:
FileSizeUploadedDownloadsMD5 hash
attachments.sql263 bytes20.03.201957e538adb54c85f5377ef82ba271e22976
mysql2sqlite.pl217 bytes20.03.2019571667eb77783094abff7be77d41ffa6e5
mysql2sqlite.sh2962 bytes20.03.201951cf13ee59dd3bf47cb687c9e528d5cb6a
mysql2sqlite.tar.gz2806 bytes20.03.201948b9f0dc6a9bb83ea2cf797f25167d8ae4
phpbb.sql17002 bytes20.03.20193019205b715ea3dd2e4a37db5758ef31fc
phpbb_schema.sql18598 bytes20.03.2019576876cc9a34a1e85a54fd20068d1d0462
AsmBB v2.5 (check-in: d3a7fac8228a901e); SQLite v3.27.2 (check-in: bd49a8271d650fa8);

©2016..2018 John Found; Licensed under EUPL.
Powered by Assembly language
Created with Fresh IDE

Icons are made by Egor Rumyantsev, vaadin and icomoon from www.flaticon.com