About to migrate from phpBB3


Well-known member

Just bought a license and really enjoying it so far. I'm looking to go live this weekend by importing the database from my current phpBB installation (already done one test import which went 100% as far as I can see). I've had a really good look through this forum the last few weeks but still have some questions...

My phpBB is currently installed in /forum and my XF installed in /community on the same hosting account. What I want to to is change XF over to the /forum folder.

I'm assuming that I rename the current forum folder, then I can change the XF over to this. Think I have found a thread on here which covers this change, and I'm hoping is straight forward!

The next thing is the htaccess redirects. I've not found a definitive thread which explains this specifically for phpBB - or one that I understand anyway ;) Can someone post a link they know a good one to follow.

Hope that all makes sense, and thanks in advance. I'm just a little nervous on changing over....

Your changeover should be fine, I moved from phpBB3 to Xenforo just 3 weeks ago. :D

I went for /community as I fancied the change, plus we were using a WordPress & phpBB3 combination which were in different folders (/home and /forums). I just used .htaccess to redirect users to the new site.

If you've not done so already, do think about the smileys you'll use on the new site. I didn't want to take the phpBB3 set with me and I didn't fancy using the default Xenforo ones (sorry!) plus there weren't enough of these anyway. I therefore got a bunch of new ones from Kolobok which was recommended to me.

There's many add-ons I would recommend but one you will find useful as an admin is Post Content Find / Replace. I used it to replace some smiley codes, convert the youtube tags to media tags and replace the URL links throughout the site (we'd done a hack on phpBB3 to open links in a new window and it left html code lying around after migration).

I hope the move goes well and you won't regret it, Xenforo is much better than phpBB3 IMO. :D
I also moved from phpBB3 (but over 12 months ago now). Brogan is also a previous phpBB user, and he helped me out a lot when I first moved over.
Yes, I converted via vB back in January 2011, so we lost passwords and weren't able to put redirects in place.

We originally had the forum in the root, then moved it to /forum/ while using phpBB.
When we converted I decided I liked the /community/ idea so went with that.

I had to tidy up all the custom BB Code we were using but a few SQL queries and the post content replace tool soon sorted that.

The difference is like night and day as far as usability is concerned.
Our posting rate increased massively, helped in no small part by the likes and alerts.
Yay! Sooo many answers and so much information in such a short time. Doesn't look like I'll be leaving the keyboard in the near future... :D

With regards to the .htaccess's supplied above, does it make any difference if I turn on the SEO url feature (which is something I'm really keen to do). It says in the ACP that the .htaccess needs to be in place, but doesn't mention what exactly.

I personally agree that domain.com/community is a much nicer option, as that's what we are trying to build - just need to convince my forum partner...
Friendly URLs should work if you have mod_rewrite installed.

My site is in the /forum directory, and below is my .htaccess section to get all the old links to redirect:
RewriteCond %{QUERY_STRING} (^|&)t=([0-9]+)(&|$) [NC]
        RewriteRule ^viewtopic\.php$ /forum/threads/%2? [L,R=301,NC]
        RewriteCond %{QUERY_STRING} f=(\d+)$ [NC]
        RewriteRule ^(viewforum\.php|viewtopic\.php)$ /forum/forums/%1? [L,R=301,NC]
        RewriteCond %{QUERY_STRING} (^|&)p=([0-9]+)(&|$) [NC]
        RewriteRule ^viewtopic\.php$ /forum/posts/%2? [L,R=301,NC]
        RewriteCond %{REQUEST_FILENAME} -f [OR]
        RewriteCond %{REQUEST_FILENAME} -l [OR]
        RewriteCond %{REQUEST_FILENAME} -d
        RewriteRule ^.*$ - [NC,L]
        RewriteRule ^(data/|js/|styles/|install/|favicon\.ico|crossdomain\.xml|robots\.txt) - [NC,L]
        RewriteRule ^.*$ index.php [NC,L]
Just ran another test import and got this... ran through fine the first time a few days ago...

Server Error
Mysqli statement execute error : Duplicate entry '2' for key 'PRIMARY'
  1. Zend_Db_Statement_Mysqli->_execute() in Zend/Db/Statement.php at line 297
  2. Zend_Db_Statement->execute() in Zend/Db/Adapter/Abstract.php at line 479
  3. Zend_Db_Adapter_Abstract->query() in Zend/Db/Adapter/Abstract.php at line 574
  4. Zend_Db_Adapter_Abstract->insert() in XenForo/DataWriter.php at line 1591
  5. XenForo_DataWriter->_insert() in XenForo/DataWriter.php at line 1580
  6. XenForo_DataWriter->_save() in XenForo/DataWriter.php at line 1381
  7. XenForo_DataWriter->save() in XenForo/Model/Import.php at line 580
  8. XenForo_Model_Import->_importData() in XenForo/Model/Import.php at line 1556
  9. XenForo_Model_Import->importPost() in XenForo/Importer/PhpBb3.php at line 1862
  10. XenForo_Importer_PhpBb3->stepThreads() in XenForo/Importer/Abstract.php at line 77
  11. XenForo_Importer_Abstract->runStep() in XenForo/ControllerAdmin/Import.php at line 180
  12. XenForo_ControllerAdmin_Import->_runStep() in XenForo/ControllerAdmin/Import.php at line 232
  13. XenForo_ControllerAdmin_Import->_startStep() in XenForo/ControllerAdmin/Import.php at line 175
  14. XenForo_ControllerAdmin_Import->actionStartStep() in XenForo/FrontController.php at line 310
  15. XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 132
  16. XenForo_FrontController->run() in /home/zroadstr/public_html/community/admin.php at line 13
Thanks Andrej,

I did create a user so I could take some screen shots. Can I just delete that user from Xenforo and then retry the import? Or has the database got to be completely clean?

Thanks, Gary
Thanks Andrej,

I did create a user so I could take some screen shots. Can I just delete that user from Xenforo and then retry the import? Or has the database got to be completely clean?

Thanks, Gary
Yes, just try to delete that user. :) According to this post it should work.

If that fails, simply add /install to your forum URL and there is a link to do a fresh install.
Re-imported a clean database from before I added the user, and that seems to allow the import to complete. I have a few issues to sort now.

1> A lot of our Youtube videos were embedded using [Youtube] tags and just the video code. I guess I'm going to need to trawl through and find these and edit accordingly?

2> Having done a full import, I can drop the database tables and re-import my "clean" database back in. Do I need to delete the Avatars and Attachments which imported, or do I just skip them when I run the final import?

Thanks to everyone for your help so far!
There's an even easier way if all embeds are identical:

UPDATE xf_post SET message = REPLACE(message, '[youtube]', '[media=youtube]');
UPDATE xf_post SET message = REPLACE(message, '[/youtube]', '[/media]');
Thanks Matt, but I don't think that will work in this case.

There is no URL, just the open and close tags and the 8 or so digit video code. See image for better idea!


It will of course work fine on those who pasted the complete Youtube URL to the video.
Ok, next question.

I currently have my install of XF in domain.com/community but I need to rename this to domain.com/forum before or after importing my phpBB database.

Is it a case of changing the Board URL setting and renaming the folder, or is it more involved than this?


Top Bottom