Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
The URL conversion from phpBB (or others) to Vanilla
candyman
✭✭
I'm tryin' to move from phpBB2 to Vanilla2 but I'm actually blocked by the different URLs scheme.
The solution is to search&replace, obviously, but Vanilla scheme uses the-name-of-the-thread as part of the url of the discussion...
So, how can I convert tons of...
http://myforum.ext/community/viewtopic.php?f=46&t=579376
into...
http://myforum.ext/discussion/16558/looking-for-successful-URLs-migration-from-phpbb2-to-vanilla2#
in a simple&fast way? Is it possible without searching&replace all the thread and change them by hand?
Thanks in advance.
The solution is to search&replace, obviously, but Vanilla scheme uses the-name-of-the-thread as part of the url of the discussion...
So, how can I convert tons of...
http://myforum.ext/community/viewtopic.php?f=46&t=579376
into...
http://myforum.ext/discussion/16558/looking-for-successful-URLs-migration-from-phpbb2-to-vanilla2#
in a simple&fast way? Is it possible without searching&replace all the thread and change them by hand?
Thanks in advance.
0
Best Answers
-
Todd Vanilla StaffThe text is indeed optional as ddumont says.
However, the way we always do imports like this is to use routes instead of changing text. So in your example I'd add a route.
Route Expression:viewtopic\.php\?f=\d+&topic=(\d+)
Target:discussion/$1/x/p1
I highly recommend setting the route's type to Internal until you've got the route expression right. When you do switch the route type to Permanent (301). The reason for this is that if you start with 301s then your browser will cache the result while you are making changes. It will make you tear your hair out if you don't know this.
The route expressions are regular expressions which can be a little tricky themselves. In the above example note the\
character before the.
and?
. Basically, you must remember to escape all special regular expression characters.1 -
Todd Vanilla StaffThe preg_replace command for the above string is.
public function RemoveBBCodeUIDs($Value, $Field, $Row) {
That's all the help I'm going to give you on this. If your not a technical person you're going to get yourself into a lot of trouble copy and pasting code snippets without any understanding of the underlying concepts.
$UID = $Row['bbcode_uid'];
$Result = str_replace(':'.$UID, '', $Value);
$Result = preg_replace('`viewtopic\.php\?f=\d+\&topic=\(\d+\)`', 'discussion/\1/x/p1', $Result);
// Other replaces here.
return $Result;
}0
Answers
There was an error rendering this rich post.
- In the thread number 1 there is UserA post that say "Hello".
- UserB quote the userA message and says "Hi" and, with the BBcode, make a clickable link named "an old topic" that points to the old discussion, in this way:
[quote="UserA, in [url=http://www.mysite.ext/forum/viewtopic.php?f=1&t=1]an old topic[/url]"]Hello[/quote]
Now, it's easy for me moving from phpBB to Vanilla but how can I preserve all these little things that are hidden inside BBcode tags?
Hope someone had already done this...
So you need to change /forum/viewtopic.php?f=1&t=1 to the vanilla url structure, correct?
There was an error rendering this rich post.
Where can I find some info about Vanilla internal structure?
I need a script to convert the old phpBB links to Vanilla and keep them working...
Hope someone can help.
There was an error rendering this rich post.
I need a script that replace, for example, any
viewtopic.php?f=forum_number&t=topic_number
into Vanilla
comment/comment_number#Comment_comment_number
The only difference is that any thread will be lost 'cause Vanilla seems to manage comments only.
However, the way we always do imports like this is to use routes instead of changing text. So in your example I'd add a route.
Route Expression:
viewtopic\.php\?f=\d+&topic=(\d+)
Target:
discussion/$1/x/p1
I highly recommend setting the route's type to Internal until you've got the route expression right. When you do switch the route type to Permanent (301). The reason for this is that if you start with 301s then your browser will cache the result while you are making changes. It will make you tear your hair out if you don't know this.
The route expressions are regular expressions which can be a little tricky themselves. In the above example note the
\
character before the.
and?
. Basically, you must remember to escape all special regular expression characters.grep is your friend.
grep is your friend.
In my previous forum migration I use a barely simple search&replace in the forum_posts file. Can you provide a formula for this, please?
I need moving phpBB referred post to Vanilla2.
According to you the search&replace method is wrong?
I'd prefer to have all the posts with the same style of linking: the route would force the redirect but the posts content would remain the same and I'll get two different styles (for "old" and "after the migration" posts) and this will cause some problems in case of another (I hope not) migration...
For this reason, I'm tryin' to change the old urls inside the posts into the Vanilla2 specific style (the migrator, at now, changes the thread url only). I need a rule to fix this (that is the same that is in the migrator, I suppose).
viewtopic\.php\?f=\d+&topic=(\d+)
into Vanilla's one
discussion/$1/x/p1
Can someone help me, please? The problem is to change all the links despite their different IDs (I wouldn't like to change them manually...).
Anyone out there have completed a similar conversion?
The particularity of my forum is that users uses reminders to other discussions very often inside their posts...
otherwise
http://www.mysqludf.org/lib_mysqludf_preg/
https://launchpad.net/mysql-udf-regexp
grep is your friend.
I know that adding that as an option wouldn't be useful for all the masses.
Thanks x00 for showing me the starting point. Todd told me about the routes. The problem is that I would obtain a forum with tons of posts with an URLs scheme and the followings with a different one... Just in case of another migration (I hope not) it would create some problem...
... and it's slower, isn't it?
In the phpbb exporters there is a function called
RemoveBBCodeUIDs
. You can add your preg_replace code there.grep is your friend.