1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Can I copy Trophy and User Title data between XF installs?

Discussion in 'XenForo Questions and Support' started by CyclingTribe, Jul 15, 2012.

  1. CyclingTribe

    CyclingTribe Well-Known Member

    I'm looking at creating quite a large number of trophies (hundreds) and wanted to use them on all four of my XF installs.

    I notice the xf_trophy user_criteria data type is BLOB and just wanted to know if I can export BLOB data and re-import it into another table, i.e. from the CycleChat xf_trophy to GeeksChat xf_trophy?

    I don't really want to have to manually setup hundreds of trophies on all four sites separately if I can avoid it.

    Cheers,
    Shaun :D
     
  2. Vincent

    Vincent Well-Known Member

    I see no problem with that at first thoughts.
    You close your forums, import the new trophies, run the update user task. Done. (I know this sounds too simple :p)

    But I'd recommend you try it out. Nothing better than that. Take 2 test forums of your forums and try it out :D
     
  3. CyclingTribe

    CyclingTribe Well-Known Member

    I've just tried a test export/import and it doesn't seem to work.

    I truncated the xf_trophy table in the recipient forum and did an SQL insert to re-create the trophies I exported from the candidate forum:

    Code:
    INSERT INTO `xf_trophy` (`trophy_id`, `trophy_points`, `user_criteria`) VALUES
    (1, 1, 0x613a313a7b693a303b613a323a7b733a343a2272756c65223b733a31353a226d657373616765735f706f73746564223b733a343a2264617461223b613a313a7b733a383a226d65737361676573223b733a313a2231223b7d7d7d),
    (10, 10, 0x613a323a7b693a303b613a323a7b733a343a2272756c65223b733a31323a2269735f6c6f676765645f696e223b733a343a2264617461223b613a303a7b7d7d693a313b613a323a7b733a343a2272756c65223b733a31353a226d657373616765735f706f73746564223b733a343a2264617461223b613a313a7b733a383a226d65737361676573223b733a353a223230303030223b7d7d7d);
    
    The test trophy I created appears in the recipient site trophy list but is missing title and description and appears in the list as trophy_10_title (should be Test Trophy).
     
  4. Vincent

    Vincent Well-Known Member

    So I guess it's stored in another table then too :S
    I'm sorry for being mister obvious guy but I don't know what else I can say/do :(

    I can help you importing them manually if you'd like. Better than hitting the "What's new" button every 5 seconds :D
     
  5. CyclingTribe

    CyclingTribe Well-Known Member

    Do you know which table the trophy title and description are stored in?

    If so I can export/import both table sets into the recipient site tables. :)

    Cheers,
    Shaun :D
     
  6. Vincent

    Vincent Well-Known Member

    No I don't :(
    And my partner doesn't want me to install PHPMyAdmin anymore, so I can't check, sorry..

    Just out of curiosity, how many trophies are we talking about?
     
  7. ragtek

    ragtek Guest

    they are stored as phrases

    title is 'trophy_' . $trophyId . '_title'
     
    Jake Bunce and CyclingTribe like this.
  8. CyclingTribe

    CyclingTribe Well-Known Member

    Thanks, but phrases, really? Any idea why they're separated and stored outside of the xf_trophy table? I'm sure there must be some logical reason, but to my mind it would make them more transportable/transferrable as a single table collection.

    Any idea how I'd query xf_phrase to extract only the trophy titles and descriptions?

    Cheers,
    Shaun :D
     
  9. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Code:
    SELECT *
    FROM xf_phrase
    WHERE title LIKE 'trophy_%';
    
     
    CyclingTribe likes this.
  10. CyclingTribe

    CyclingTribe Well-Known Member

    Excellent. Thanks for the help guys. :D
     
  11. ragtek

    ragtek Guest

    CyclingTribe likes this.

Share This Page