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

Pligg2Hotaru 0.2

Discussion in 'Plugins' started by Nick, Aug 16, 2010.

  1. Nick

    Nick Well-Known Member

    Version: 0.2
    Author: Nick Ramsay
    Created: 2010/08/16
    Last Updated:
    Tested on: Hotaru 1.4.1
    Plugins Required: None
    Plug & Play: Yes, but needs some preparation (see instructions)
    Supported: Yes

    Import a Pligg or SWCMS database into Hotaru CMS. Version 0.1 imports the following tables: Links, Comments, Users, Categories, Tags and Votes. It doesn't import favorites, messages, friend data or anything else. Please hire me if you have special requirements.

    Difference to Pligg Importer
    The Pligg Importer plugin used XML exports and tons of memory. It's also incompatible with the latest versions of phpMyAdmin and I've ended my support for it. Pligg2Hotaru uses SQL exports and works with batches of data to keep memory usage down. It is compatible with the most versions of phpMyAdmin.

    Depending on the size of your Pligg database, importing each file can take a long time. This isn't a straight import. Almost every aspect of your Pligg database is changed. For example, all users will get a new id number, so every table with a user_id field needs updating with this new id. The same goes for link ids, category ids etc.

    1. Make sure your Hotaru username and password match your old 'god' account from Pligg.
    * If your Pligg username was 3 characters (e.g. "god" or "tom"), go to your Hotaru Account page and add "1" to your username (e.g. "god1" or "tom1").
    * If your Pligg password is not at least 8 characters and only contains letters, numbers and these symbols: ! @ * # - _ then you will need to change your password in Pligg before using this plugin.
    * After changing your Hotaru username or password, log out and then log back in again.
    2. From phpMyAdmin (or similar) export your whole Pligg database as SQL, then import it into your Hotaru database (this will only work if your Pligg tables have a different prefix to Hotaru tables, e.g. "pligg_")
    3. Upload the "pligg2hotaru" folder to your plugins folder.
    4. Install it from Plugin Management in Admin.
    5. Click Pligg2Hotaru in the Admin sidebar and follow the steps.

    After importing...
    When you've successfully imported your Pligg data into Hotaru and are satisfied it worked, you can delete all the old Pligg tables from the front page of the Pligg2Hotaru plugin. Some users won't be able to log in, so use the Admin Email plugin to inform them of these two points:
    * If their username was 3 characters, they should add "1" to the end of it when they log in. After they have logged in, they can change their username again from their profile.
    * Passwords in Hotaru must be at least 8 characters and can only contain letters, numbers and these symbols: ! @ * # - _ Any user with a password that fails will need to use the "Forgotten Password" form on the login page to get a new password.
    Big databases usually require some workarounds to prevent timeouts, etc. Here are some tips:
    * If you are coming from SWCMS, consider using the SWCMS DB Cleanup module before importing your site (not sure if it works for Pligg. It probably does.)
    * Export the links, comments, users, categories, tags and votes tables individually from your Pligg database and import them into the Hotaru database one-by-one.
    * Export your tables with compression, e.g. "zipped" or "gzipped".
    * If you have access to php.ini, change "max_execution_time" to 3600 seconds (1 hour)
    * If using phpMyAdmin, open config.inc.php and add or set $cfg['ExecTimeLimit'] = 3600;
    * If you don't have access to php.ini, try adding the set_time_limit function to the foreach loops in the each file. Alternatively, try .htaccess.

    Revision History
    v.0.2 2010/08/18 - Nick - Fix for missing email values in Pligg
    v.0.1 2010/08/16 - Nick - Released first version

    Please click "Rate Thread" and give this plugin a rating. Thank you.

    Attached Files:

    JonH, carlo75 and narc like this.
  2. carlo75

    carlo75 Design & Development

    A new challenge for trying to port my pligg in hotaru...
    is it very exciting, and I'll try asap... stay tuned for the result :p
  3. carlo75

    carlo75 Design & Development

    Got an error. After 2 hrs of importing, at step 4 of 7, on Users, I receive this error:

    Notice: Undefined property: stdClass::$valid_email in
    C:\wamp\www\hotaru\content\plugins\pligg2hotaru\libs\users.php on line 87


    Notice: Undefined property: stdClass::$email_conf in
    C:\wamp\www\hotaru\content\plugins\pligg2hotaru\libs\users.php on line 88

  4. Nick

    Nick Well-Known Member

    Okay, Carlo. I see, those were added to SWCMS and aren't in Pligg.

    Try this. Open, /pligg2hotaru/libs/users.php and change this:

                        //if not using SWCMS' email registration module, set to zero:
    if (!$child->valid_email) { $child->valid_email 0;}
                        if (!
    $child->email_conf) { $child->email_conf 0; }
    to this:
                        //if not using SWCMS' email registration module, set to zero:
    if (!isset($child->valid_email)) { $child->valid_email 0;}
                        if (!isset(
    $child->email_conf)) { $child->email_conf 0; }
    Sorry it has taken so much of your time. If this change works for you, I will update the plugin with it.
  5. carlo75

    carlo75 Design & Development

    Perfect Nick, I restart the importing process, with your modification; and no problem for my time it can't be compared with the amount of days that you spend in this project!
    Nick likes this.
  6. Nick

    Nick Well-Known Member

    Updated to version 0.2, fixing the issue reporter by Carlo.
  7. carlo75

    carlo75 Design & Development

    Little update:
    Users step successfully passed
    elaboration time until now: 4 hrs
  8. carlo75

    carlo75 Design & Development

    Finish, conversion complete.


    Elaboration time: ~6Hrs
    Pligg Links: ~ 80.000
    Pligg Users: ~ 8.900
    Pligg Comments: ~ 2.500
    Pligg Vote: ~ 153.000
    Pligg Tags: ~ 250.000

    I've always some problem with character set, but this was only a test. From now I'll try to export pligg SQL in a charset that best fit my needs. Hower pligg2hotaru now works fine also for me.
    Nick likes this.
  9. narc

    narc Well-Known Member

    pligg2hotaru is the best thing that can happen to Pligg users. my local installation works wonderfully. now missing is a new template. adaptation of plugins. then you also have a lucky fan from Germany.

    but one is still missing. import the pictures from left Pligg to hotaru. image when I use the plugin by hotaru. that would be cream first.

    many thanks nick.
  10. narc

    narc Well-Known Member

    how can I remove the posts in <br/>. if more than three in succession are?

    lorem impsum lorem impsum lorem impsum<br>
    lorem impsum lorem impsum lorem impsum<br>
    import hotaru
    lorem impsum lorem impsum lorem impsum<br>
    lorem impsum lorem impsum lorem impsum<br>
  11. JonH

    JonH Admin & Design

    Pligg2Hotaru 0.2 with extra fields 1-15

    If your SWCMS/Pligg site was using the "extra fields" 1 through 15 in the database, attached is a version of Nick's plugin that will create the 15 "link_field" columns in your Hotaru database and transfer the data over with the rest of the conversion.

    Pliggs/SWCMS' extra fields were used mostly with 3rd party modules and hacks (image upload etc) so if you don't know about them you probably don't need this version.

    I tested it with SWCMS 1.0 with 2 different databases on a local install and once on a live server and it worked fine. I would recommend giving it a run on a test install first, but hey it's for new installs so it probably wouldn't make much difference!

    Attached Files:

    petsagouris and Nick like this.
  12. bbrian017

    bbrian017 New Member

    I hate to sound like an idiot but if my pligg admin username was blogengage I want my hotarucms username to be blogengage1



  13. Nick

    Nick Well-Known Member

    You can change your name after you've completed importing everything.
  14. bbrian017

    bbrian017 New Member

    How long does this process normally take?

    Categories went fine but the 2nd step has been loading for about an hour now.

    I have 60 categories
    I have 5000 members
    I have 25,000 submissions
    I have 6000 comments
    I have 198,000 votes
    Last edited: Nov 3, 2010
  15. narc

    narc Well-Known Member

    a question, this plugin works with the new version hotaru?
    I want my project: migrate http://hype.pbguide.com/ to hotaru. at the moment it is still under pligg.

    would be glad if that would work. I separate myself from pligg very much.
  16. nothingman

    nothingman Active Member

    Narc, the Web sites that you take care of have lovely themes/look - Unique I must say!

    Going back to your question, why don't you try it out locally (Xampp?). If you have a lot of posts/comments on your site, expect your processor/memory to be used to the optimum.

    - - - Updated - - -

    Narc, the Web sites that you take care of have lovely themes/look - Unique I must say!

    Going back to your question, why don't you try it out locally (Xampp?). If you have a lot of posts/comments on your site, expect your processor/memory to be used to the optimum.
    narc likes this.
  17. shibuya246

    shibuya246 Hotaru Developer Staff Member Admin

    I have never used pligg so am not sure, but the database structure hasnt changed in this latest version so I think it should still work as it did before. let me know if any errors come up and I can take a look
    narc likes this.
  18. Nick

    Nick Well-Known Member

    There's a good chance the database in recent versions of Pligg has changed. Pligg is close to v.2.0 now, whereas this plugin was made for Pligg 0.9.x. It would be great if someone could test this to see if it still works.
    narc likes this.

Share This Page