What Do You Need In The Xf2 Xengallery Version? Vote for your choices here: http://www.sonnb.com/threads/what-do-you-need-in-the-xf2-xengallery-version.1539/

Question Error When Importing Xfr_useralbum

Discussion in 'XenGallery' started by snoopy5, Jan 19, 2014.

  1. snoopy5

    snoopy5 Authorized Member Authorized

    Hi,

    I imported one XF forum "B" into another XF forum "A". Forum "A" is now the master. But in B was the addon XFR_useralbum installed.

    So I tried now to import this XFR_useralbum into Forum "A". But strangely, it proposes the wrong database #188 instead of #215, which is the one of forum "B" . The database #188 is the one of the master forum. But in the master forum was never a XFR-useralbum installed.

    If I try to change the numbers, sonnb importer just ignores it and sticks with #188. The error message is:

    Code:
    Server Error
    
    Mysqli prepare error: Table 'db176009_188.xfr_useralbum' doesn't exist
    
        Zend_Db_Statement_Mysqli->_prepare() in Zend/Db/Statement.php at line 115
        Zend_Db_Statement->__construct() in Zend/Db/Adapter/Mysqli.php at line 381
        Zend_Db_Adapter_Mysqli->prepare() in Zend/Db/Adapter/Abstract.php at line 478
        Zend_Db_Adapter_Abstract->query() in Zend/Db/Adapter/Abstract.php at line 753
        Zend_Db_Adapter_Abstract->fetchRow() in sonnb/XenGallery/Importer/UserAlbum.php at line 91
        sonnb_XenGallery_Importer_UserAlbum->stepAlbums() in XenForo/Importer/Abstract.php at line 77
        XenForo_Importer_Abstract->runStep() in XenForo/ControllerAdmin/Import.php at line 195
        XenForo_ControllerAdmin_Import->_runStep() in XenForo/ControllerAdmin/Import.php at line 247
        XenForo_ControllerAdmin_Import->_startStep() in XenForo/ControllerAdmin/Import.php at line 190
        XenForo_ControllerAdmin_Import->actionStartStep() in XenForo/FrontController.php at line 347
        XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
        XenForo_FrontController->run() in /kunden/176009_65183/foto/cameraforum/admin.php at line 13
    
    What is the reason for this and how can I fix it?

    Thanks

    P.S. Xenforo version 1.24 on Forum A and 1.13 on forum B. Xengallery version 2.06
     
  2. sonnb

    sonnb Administrator Staff Member

    Because Importer will get information in current database (which is 188, where XF instance you currently on). In another hand, it supports local database importing only.
     
  3. snoopy5

    snoopy5 Authorized Member Authorized


    mmmhhhh....

    What about this idea:

    All users are imported already anyway in db#188

    1. I copy all tables of db #215 with xfr_ in it and paste them into db#188
    2. I run the importer again

    Would this then work. Or do I oversee something?
     
  4. sonnb

    sonnb Administrator Staff Member

    If all users has the same ids in both database then you can do that way ;)
     
  5. snoopy5

    snoopy5 Authorized Member Authorized

    Hi,

    no, they do not have all the same IDs, because I imported in the master db beforehand other db...

    Is it possible to import it nevertheless and change afterwards the owners of the albums?

    How difficult would it be to change the import script so that it is supporting different db?
     
  6. snoopy5

    snoopy5 Authorized Member Authorized

    Hi,

    I did this now manually with phpmyadmin:

    1. Install the old addon XFR-useralbum in the master XF-Forum

    2. export the 6 db tables one after the other of the xfr_useralbum of the other XF-forum:

    xfr_useralbum
    xfr_useralbum_album_view
    xfr_useralbum_image
    xfr_useralbum_image_comment
    xfr_useralbum_image_data
    xfr_useralbum_image_view

    3. Open the files one by one and change db# from 215 to 188 (user your own correct nmbers) in each file. Save this.

    4. Go to the db of the master forum, delete there the fresh and empty xfr_useralbums tables and import into this db the modifids export-files.

    5. Look now in the old XF-forum for the username of the users who uploaded images in the albums and write down their username and the name of their albums

    6. Search now in the new db of the master XF-forum for these usernames, write down theirnew user IDs

    7. Exchange in the table xfr_useralbum of the master xf forum the wrong user id with the correct one by looking for the album name. Write down the wrong user id beforehand. You need that later.

    8. Go now to the table xfr_useralbum_image_data of the master forum and look for teh wrong user ID, change that to the corrct user id of the master forum.

    9. Do the same for the table xfr_useralbum_image_comment

    Seems to work like this.

    But better would be an importer who can pick the albums images not only from the master db, but also from other db ;)

    Best wishes
     
  7. sonnb

    sonnb Administrator Staff Member

    Thank you snoopy. That was really a hard workaround. Highly appreciate that.
     

Share This Page