Migrate from TravelPortals

hi.. i also had to do this process when first tested and installed MyPortals of my own .. sorry, at this time i have no specific tool for this so you need...

TOOLS:

  • excel or some other spreadsheet software
  • a regular expressions capable text editor like notepad++ or vim
  • a little knowledge on working with spreadsheet software and regular expressions
  • download MyPortals.jar, v12+ recommended

sadly TravelPortals data file is binary and you can't read, but luckly it comes with the subcommand "export", so you can export your TP portals at server console with this command

portal export

this will read your portal data and dump into file "travelportals.txt" at plugin directory (<craftbukkit dir>/plugins/TravelPortals/) .. this is a csv file and looks like

-3131,70,-488,,,false,world,ATESIN
-3138,62,-471,casaAtesin4,subLaberinto,false,world,ATESIN
-891,61,-278,subLaberinto,casaAtesin3,false,world,ATESIN

format is: xyz player coordinates, portal name, destination name, hidden portal flag, world name, owner .. myportals data is in a yml text file so you can edit carefully and reload the server .. the 2nd portal would be like:

W-3138+61-471:
- ATESIN
- casaAtesin4
- '0.0'
- '0'
- '0'
- W-891+60-278

format is: key=encoded portal base block location, owner, portal name, player orientation (yaw) when get teleported, portal facing (see F3 minecraft info screen), privacy setting (0-3 = public, locked, hidden, private), and destination portal key

note to save space the encoded location format is a string that uses an uppercase as world name prefix ("W" default for "world", configurable since myportals v9) and number signs as separators, also note Y coordinate are minor because locations are for PORTAL BASE BLOCK (the block under the feet of the player, not the location of the player itself) .. the last value are the destination portal key, if absent must be "null" (no quotes) ..

note in travelportals each portal is represented by a single line with fields, when in myportals each portal is represented by a block of lines with values .. you need to try to match each field with myportals format as close as possible before split lines, for that you need to copy travelportals.txt to travelportals.csv, open in excel or equivalent, and do...

  • split each field by semicolon if not already done
  • encode locations with a formula like ="W+"&xcoord&"+"&ycoord-1&"+"&zcoord and replace "+-" with "-"
  • replace portal destination names with encoded locations
  • enclose empty portal names with single quotes, replace empty destinations with word "null" (no quotes)
  • add the zeroes as shown, if hidden portal is "true" replace the last zero with a 2
  • try to match each field with myportals format as close as possible (colons, dashes, quotes, etc.) and save the CSV file again

now you have to split lines by replacing semicolons with newlines (regex "\n") .. this is an example for notepad++ replace text dialog, ensure to select "regular expression" checkbox before apply

find what: ;
replace with: \n

take a last look to the file and when you were ready save it .. now you can disable travelportals and install myportals .. after the first myportals run you should stop the server and copy your resulting file to <craftbukkit dir>/plugins/MyPortals/data.yml

now you can proceed to configure your plugin, your worlds, the default portal shape (read config.yml comments), some translation file if you want (send it to me!) .. then reload (fast) or restart (safe) the server and do a "portal rebuild" console command (since v11) .. if all went ok and there is no exceptions in console the migration was successful

congratulations, now you are using MyPortals