News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

How do I rewrite old PHPBB url's?

Started by pocholo, November 26, 2006, 07:14:38 AM

Previous topic - Next topic

pocholo

Hello,

I'm thinking in migrate my boards to simplemachines and I need to rewrite the old PHPBB url's of my website to simplemachines new ones. Can anybody help me with this problem?

Thanks in advance ;)

winrules

What do the phpbb URL's look like that you want to rewrite? Do you jsut want to rewrite links to the topics?


winrules
SMF Developer
               
My Mods
Please do not PM me for support.


pocholo

#2
Hello winrules!

My website is well indexed at search engines. So if I migrate to simplemachines everybody that come from search engine will get a 404 document not  found.

VBulletin has a script to redirect old url's to new ones. You take a look at hxxp:www.google.es/search?hl=es&rls=GGLJ%2CGGLJ%3A2006-38%2CGGLJ%3Aes&q=site%3Atodoxbox360.com+inurl%3Atodoxbox360.com%2Fforos%2F&meta= [nonactive]

JayBachatero

Since phpBB uses different files for actions ie (SMF action=topic while phpBB showtopic.php...).  The best way to do this is with a 301 htaccess redirect. 
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

pocholo

JayBachatero do you know if this code is in this forum? Will be really nice to get it :D

Regards, pocholo

JayBachatero

Umm not it's not in the forum.  I'm not very familiar with .htaccess and such, so I can't really give you a hand but I'm sure someone what is familiar with it can give you a hand.  I'll google a bit and see if I find anything.
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

AllMassive

#6
I think you want to alter the old URLs to point to the new forum, right =

Do this on the Database with phpmyadmin:

UPDATE smf_messages
SET body = REPLACE(body, 'old_text', 'new_text')
WHERE body LIKE '%old_text%'



for ex.:

UPDATE smf_messages
SET body = REPLACE(body, 'phpbb.domain.com', 'smf.domain.com')
WHERE body LIKE '%phpbb.domain.com%'


This replaces ever URL containing 'phpbb.domain.com' with 'smf.domain.com'.

You should do a Backup before doing this command.

This one doesnt convert the URLs in the Private Messages.

jhollin1138

When I converted from phpBB to SMF, I had the same problem.  I just wrote a 'viewtopic.php' and 'viewforum.php' scripts to automatically redirect the old phpBB URL's to SMF.  I have attached them for your use.  You just need to put them in the your SMF directory and that is it.  Assuming that you have SMF installed to is the same place where phpBB was installed.

Here is some links to see everything in action.
hxxp:forums.jhollin1138.com/viewtopic.php?p=14541 [nonactive]
hxxp:forums.jhollin1138.com/viewforum.php?f=16 [nonactive]

nacoya

hi there,

just installed my first smf as a trial and converted my phpbb database.

Thanks for there files they work great.

perhaps a dumb question but as you can write some php redirects would it be possible to apply the same theory to writing an sql script to convert them all in the database ?

cheers,

jhollin1138

Quote from: nacoya on November 28, 2006, 08:27:57 PMjust installed my first smf as a trial and converted my phpbb database.

Thanks for there files they work great.

perhaps a dumb question but as you can write some php redirects would it be possible to apply the same theory to writing an sql script to convert them all in the database ?
If I understand your question correctly, I really don't think it will work. SMF and phpBB store and access the forum's posts and boards so differently.  The quickest and easiest solution I could come up with was what I did.

Pedja

Not so long ago i posted on this forum complete set of files to replace old phpbb scripts and do proper redirection to SMF url-s.

http://www.simplemachines.org/community/index.php?topic=120863.0

monkeyangst

I'm trying to figure this out myself. I know it will require some knowledge of .htaccess... what you're trying to do is take a particular url in the form:
http://www.example.com/viewforum.php?f=10 [nofollow] (phpBB2 style)

and turn it into:
http://www.example.com/index.php?board=10.0 [nofollow] (SMF style)

.htaccess can do this... it's just a matter of figuring out how.

I haven't figured it out yet. htaccess is really, really confusing for me. Anyone got any skill with it?

pocholo

Quote from: Pedja on November 29, 2006, 01:36:10 AM
Not so long ago i posted on this forum complete set of files to replace old phpbb scripts and do proper redirection to SMF url-s.

http://www.simplemachines.org/community/index.php?topic=120863.0


Pedja your my god!!!! :D Thank you very much ;)

Regards

H

I believe that imported topics will be assigned new IDs starting from one. Therefore if you have ever deleted a topic the IDs will be out of sync
-H
Former Support Team Lead
                              I recommend:
Namecheap (domains)
Fastmail (e-mail)
Linode (VPS)
                             

JayBachatero

Actually no Huw.  That is only the case when converting from flat file forums like YaBB.
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

H

-H
Former Support Team Lead
                              I recommend:
Namecheap (domains)
Fastmail (e-mail)
Linode (VPS)
                             

Pedja

Quote from: huwnet on November 29, 2006, 12:23:27 PM
I believe that imported topics will be assigned new IDs starting from one. Therefore if you have ever deleted a topic the IDs will be out of sync

I checked this and get to the concluosion that conversion does not change ID's, it copies them from phpBB2.

Advertisement: