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

Pligg Importer 0.8

Discussion in 'Deprecated Plugins' started by Nick, Aug 16, 2009.

Thread Status:
Not open for further replies.
  1. Nick

    Nick Well-Known Member

    Pligg Importer
    Version: 0.8
    Author: Nick Ramsay
    Created: 2009/08
    Last Updated:
    Tested on: Hotaru 1.0.0 ~ 1.3.0
    Plugins Required: None
    Plug & Play: Yes, but needs some preparation (see instructions)
    Supported: No

    This plugin no longer works with the latest versions of phpMyAdmin. Please use the Pligg2Hotaru plugin instead. :cool:

    Import a Pligg or SWCMS database into Hotaru CMS. Version 0.8 imports the following tables: Links, Comments, Users, Categories, Tags and Votes. It doesn't import favorites, messages or friend data, so if those are important to you, you might want to wait a while before using this plugin.

    1. Export these tables as non-zipped XML files from your Pligg database: categories, comments, links, users, tags and votes.
    2. If you have access to php.ini, check that upload_max_filesize is greater than the largest XML file you exported. Contact your webhost for help.
    3. Give the Uploads folder in /content/plugins/pligg_importer/ is writable (chmod 777 in FTP).
    4. Create an account with the same login, email and password your god or admin user had on your Pligg site. This ensures you are still logged in as an administrator even after you overwrite the current users table during the import. (See this comment about changing the username "god" to a four character name)
    5. Click Pligg Importer in the Admin sidebar and when ready, click "Import a Pligg Database" and follow the steps.

    Note: 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 that has a user_id field needs updating with this new id. The same goes for link ids, category ids etc. Your server's CPU/database will be pushed to its limits! If you are coming from SWCMS, consider using the SWCMS DB Cleanup module before importing your site.

    Help Needed
    This plugin has been developed using a Social Web CMS database, which is almost identical to Pligg If you have a non-empty Pligg 1.0 database and can test it with this plugin, that would be greatly appreciated.

    Revision History
    v.0.8 2010/01/03 - Nick - Updates for compatibility with Hotaru 1.0
    v.0.7 2009/11/22 - Nick - Bug fixes for illegal offset warnings
    v.0.6 2009/11/01 - Nick - Updated to copy a user's IP address from Pligg to Hotaru
    v.0.5 2009/10/17 - Nick - Renamed CSS 'next' as 'pliggimp_next' to avoid clashes
    v.0.4 2009/10/08 - Nick - Updates for compatibility with Hotaru 0.7
    v.0.3 2009/10/01 - Nick - Updates for compatibility with Hotaru 0.6
    v.0.2 2009/08/28 - Nick - Added Comments and changed "Character Cleaner"
    v.0.1 2009/08/16 - Nick - Released first version

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


    Attached Files:

    Last edited: Nov 4, 2009
    davidshq likes this.
  2. davidshq

    davidshq Member

    Should this be renamed Pligg / SWCMS Importer?
  3. Nick

    Nick Well-Known Member

    It works with SWCMS at the moment, but we've got to keep upgrading it to match any changes at Pligg. It would probably be safer to copy this now and rename it SWCMS Importer.
  4. nothingman

    nothingman Active Member

    Nick, it's just like you mentioned. I just couldn't go ahead with importing the links (5,900 rows) and comments tables (131,540 rows!). I kept on getting a time-out error. I guess it's time to archive a portion of the site. Any tips on going about archiving a portion of an existing swcms/pligg site would be really helpful - but then that'd be going off-topic :)
  5. Nick

    Nick Well-Known Member

    If I were you, I'd set up Hotaru on your computer with WAMP or XAMPP. That way you can edit your php.ini file yourself. Find upload_max_filesize and change it to something big like 50M. There are also timeout options (which I haven't tried): mysql.connect_timeout, mssql.timeout, default_socket_timeout.

    If you can do import your site on your own computer, then you can export the results as regular zipped SQL files and import those to Hotaru on your server.
  6. Nick

    Nick Well-Known Member

    Also, you can increase the amount of memory allowed for PHP in the php.ini file. Change memory_limit to something bigger, e.g. 128M.

    Finally, if the XML file you are trying to upload is bigger than 30MB, the Pligg Importer plugin won't accept it. You can change that by opening /content/plugins/pligg_importer/pligg_importer.php and changing this line (approx. line 257 in the save_uploaded_file function):

    $size_limit 31457280// 30MB
    nothingman likes this.
  7. nothingman

    nothingman Active Member

    Thanks nick. I'm on shared hosting (godaddy) and looks like I don't have permissions to modify the php.ini file. Bummer! :(
  8. Nick

    Nick Well-Known Member

    Try the way I suggested. WAMP is surprisingly easy to set up (touch wood). With WAMP, you can do the whole import on your own computer then upload your database to your server when you're finished. That's what I plan to do with JapanSoc.
  9. carlo75

    carlo75 Design & Development

    in instruction you tell to rename username of hotaru admin, to match old user administrator in pligg.

    Now, if the admin user of pligg was the default god, when user change its hotaru admin username, an alert message advise that username must be at least 4 characters. Need to change username admin via phpmyadmin, is it correct?
    Nick likes this.
  10. Nick

    Nick Well-Known Member

    Ahhh, good catch Carlo. I forgot about that because I renamed my god user a long time ago. Hmm...

    Three options:

    1. Change "user_login" from "god" to something with 4 characters or more in phpMyAdmin in the Pligg/SWCMS users table in the database.


    2. Change "user_username" to "god" in phpMyAdmin in the Hotaru users table. After importing, change your name to something 4 characters or more from your Account page.


    3. Export the Pligg/SWCMS users table in XML format, open the file and change "god" to something with 4 characters or more before importing:


      <!-- Table swcms_users -->
    I will add these instructions to the plugin when I next update it.
    carlo75 likes this.
  11. angolanmade

    angolanmade Well-Known Member

    Here are some issues that i encountered trying to import the contents of a swcms site:

    1. During the import of the users table i get the following warning, however users do import successfully.

    Warning: Illegal offset type in isset or empty in /libs/UserBase.php on line 902

    2. After the import, I get an access denied message and I no longer have access to the admin side of site although i changed my Hotaru username and password to match the 'god' account from the SWCMS site.

    3. I also noticed that if i log out, Im no longer able to log back in, although the user name is in the hotaru_users table with admin permissions.
    It also looks like i cant login with any users that were imported

    4. Im unable to complete the last step of the import, which i believe is the votes table.

    Any thoughts!
    Last edited: Nov 21, 2009
  12. Nick

    Nick Well-Known Member

  13. Nick

    Nick Well-Known Member

    Okay, I've uploaded v.0.7 which should fix those problems. It works for me now. Thanks for the feedback!
  14. angolanmade

    angolanmade Well-Known Member

    Awesome stuff, works will test further. I noticed that some pligg/swcms sites had the Embed Videos v0.51 module installed which allowed sites to embed videos using certain tags.


    Any thoughts on how to handle using posts/links?
  15. Nick

    Nick Well-Known Member

    It's probably best to leave them there and make a plugin to convert them to videos. I haven't used that module before, so please post as much detail as possible about what this plugin should do in the Plugin Suggestion Box. Thanks.
  16. Nick

    Nick Well-Known Member

    Another setting in php.ini which helps is max_execution_time. If you're using WampServer, don't forget to restart all services after saving and editing the php.ini file.
  17. angolanmade

    angolanmade Well-Known Member

    This importer is awesome, i few things that i noticed:

    1. <br /> tags get added to post descriptions upon importing stories.

    2 .How would i go about importing posts that contained youtube videos by using allowed HTML tags in the description

    Example <youtube>Jn1MxeG5Bgg</youtube>

    In order for this to be achieved on swcms/pligg website the embed Embed Videos Module v0.51 had to be installed. Ive attached this module.


    Attached Files:

  18. Nick

    Nick Well-Known Member

    The Pligg Importer doesn't change post descriptions in any way, so if you had youtube tags in your SWCMS posts, they will be included in Hotaru posts. Of course, you'd need a plugin to convert their content to videos. Break tags get added by the SB Base plugin - if you want, you can remove the nl2br function from line 70 of the sb_post.php template.
  19. angolanmade

    angolanmade Well-Known Member

    Invalid file: Must be text/xml

    I'm getting the following error when trying to import the swcms_links.xml file using the pligg importer

    Invalid file: Must be text/xml

    Ive exported all my files as xml.

    any suggestions. I was able to import these files with 1.05.
  20. Nick

    Nick Well-Known Member

    There were no changes to the Pligg Importer between Hotaru 1.0.5 and 1.1.

    You'll get that Invalid file message if it's a) not a text/xml file, or if the Pligg Importer was unable to get the file type for whatever reason.

    Are you doing this on a live web server or offline with WampServer, XAMPP, etc? If the latter, read through this entire thread and adjust your php.ini settings. Increase file sizes and timeouts so they are really high, that way you can rule them out as possible causes of these problems.
Thread Status:
Not open for further replies.

Share This Page