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

    Do you have Debug mode on? It would be helpful if we knew if there were any errors.
     
  2. Nick

    Nick Well-Known Member

    Also, let's not forget this:

    Could your problems be caused by differences between a Pligg 1.0 database and a Pligg 0.9.9.5 one?
     
  3. mabujo

    mabujo Designer

    Debug mode is on but no errors are showing up in the logs. :-/
    It is a Social Web CMS 1.1.0 database.
     
  4. mabujo

    mabujo Designer

    When exporting the XML dumps, do you usually export just the contents or the structure schemas, functions, procedures, tables, views e.t.c. as well? I guess it would only be the structure and tables that would be exported, but should these be exported or not? Does it make a difference?
     
  5. Nick

    Nick Well-Known Member

    I use phpMyAdmin and that doesn't have any options when you export in XML, so I'm not sure.
     
  6. mabujo

    mabujo Designer

    Oh, my version of phpMyAdmin does!
    Well, I've tried it both ways and neither work. I'm screwed?!
     
  7. Nick

    Nick Well-Known Member

    Short of diving into the code to find the cause of the problem, or hiring someone else to, then I'm afraid so! :eek:
     
  8. mabujo

    mabujo Designer

    I've taken the former option for the moment. var dumps seem to suggest the script isn't picking out the fields from the file.
    Can anyone offer an example of what a valid/acceptable XML schema would look like?
     
  9. Nick

    Nick Well-Known Member

    Not sure if it's helpful, but I've attached my old SWCMS categories table as an XML file. Had to .zip it so I could attach it here, though.
     

    Attached Files:

    mabujo likes this.
  10. mabujo

    mabujo Designer

    Thanks Nick, will have a look through it tomorrow and see if I can chop some sense into mine...
     
  11. mabujo

    mabujo Designer

    Progress! Haven't got it fixed yet but I thought I would document my progress so far as it seems other users could face the same problem.

    I had a look at Nick's attached xml and the schema is indeed different from mine.

    Nick's :
    Code:
    <swcms11>
      <!-- Table japansoc_categories -->
        <japansoc_categories>
            <category__auto_id>0</category__auto_id>
            <category_lang>en</category_lang>
            <category_id>0</category_id>...
    mine :
    Code:
    <pma_xml_export version="1.0">
        <!--
        - Database: 'oldswcmsdb'
        -->
        <database name="oldswcmsdb">
            <!-- Table swcms_categories -->
            <table name="swcms_categories">
                <column name="category__auto_id">0</column>
                <column name="category_lang">en</column>
                <column name="category_id">0</column>
    so you can see mine is in <column name="column"> format whereas Nick's is just <column name>.

    Why?
    Well the tops of the files reveal all :

    Nick's :
    Code:
    <!--
    -
    - phpMyAdmin XML Dump
    - version 3.2.5
    - http://www.phpmyadmin.net
    -
    - Host: localhost
    - Generation Time: May 12, 2010 at 11:56 PM
    - Server version: 5.1.36
    - PHP Version: 5.2.11
    -->
    mine :
    Code:
    <!--
    - phpMyAdmin XML Dump
    - version 3.3.2deb1
    - http://www.phpmyadmin.net
    -
    - Host: localhost
    - Generation Time: May 13, 2010 at 11:32 AM
    - Server version: 5.1.41
    - PHP Version: 5.3.2-1ubuntu4
    -->
    I found this page on the phpmyadmin wiki that states "NOTE: The XML schema used has changed as of version 3.3.0".
    So that will be it. Anyone who has phpmyadmin greater than 3.3.0 will run into this problem.

    I edited my categories xml to match Nick's (luckily it is a small file) and the pligg importer plugin took it straight away.
    Obviously I can't do that for all files because they are much too large, so the options at this point seem to be :

    • Somehow roll back my version of phpmyadmin
    • Write a script to export the tables from the database to match the same schema as Nick has
    • Modify the plugin for versions of phpmyadmin after 3.3.0
     
    Nick likes this.
  12. Nick

    Nick Well-Known Member

    That's quite a discovery! And a shame, too, because there's nothing fancy in the plugin code that reads in the data. I just used the PHP function "simplexml_load_file" to automatically read the whole .xml file into a PHP object. This change makes things much more complicated. :(
     
  13. mabujo

    mabujo Designer

    It is a shame but luckily a version of option 1 from above was fairly simple.
    Rather than roll it back I kept my package managed version of phpmyadmin but made an additional install by grabbing phpmyadmin 2.11.10 from here.

    That version spits out an xml file that has the same schema as yours and the import now seems to be working.
     
  14. incoe

    incoe New Member

    i just tested the script on pligg 1.0.4 its working fine but the only problem between the two is the user will reset the password, cause pligg allow 6 characters pass and hotaru accepts 8 characters minimum, will test on live server now to make sure everything is working fine :)
    thanks for the plugin
     
    Nick likes this.
  15. Nick

    Nick Well-Known Member

    Thanks for testing it on Pligg 1.0.4. The shorter Pligg passwords and 3 letter user names are a pain, but can't be helped.
     
  16. incoe

    incoe New Member

    i guess the only thing missing is after we import we add another mailing module to send all members and email saying "for security reasons we have upgraded your password to a minimum of 8 characters or so :)
     
  17. Nick

    Nick Well-Known Member

    I used the Admin Email plugin to notify my users.
     
  18. incoe

    incoe New Member

    will try it out :) thanks for sharing,
    which pligg did you move from by the way?
     
  19. Nick

    Nick Well-Known Member

    I didn't, technically... We forked Pligg (0.9.8.2) in 2008 as Social Web CMS, which was later rebuilt as Hotaru. I originally made this plugin for SWCMS users (including myself) to "upgrade" to Hotaru.
     
  20. incoe

    incoe New Member

    ah gotcha :)
    great, pligg is so frustrating anyway, your system is much smaller and much faster
     
Thread Status:
Not open for further replies.

Share This Page