Almost got it, only one item left for success.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • RazorsEdge
    Member
    • Mar 2012
    • 53
    • 4.2.X

    Almost got it, only one item left for success.

    I am so close to 100% successful import. My last hurdle has me scratching my head. For some reason I am not able to import attachments from any posts. I am importing from a test database of smf 2.0.2
  • Lynne
    Former vBulletin Support
    • Oct 2004
    • 26255

    #2
    Are your attachments in the file system or in the database? They must be in the database.


    Please don't PM or VM me for support - I only help out in the threads.
    vBulletin Manual & vBulletin 4.0 Code Documentation (API)
    Want help modifying your vbulletin forum? Head on over to vbulletin.org
    If I post CSS and you don't know where it goes, throw it into the additional.css template.

    W3Schools <- awesome site for html/css help

    Comment

    • RazorsEdge
      Member
      • Mar 2012
      • 53
      • 4.2.X

      #3
      Thank you for the quick response. I do not think smf gives the option of attachments in the database but only the file name to the attachment is stored int he database. The attachment itself is stored in a folder on the server.

      Comment

      • RazorsEdge
        Member
        • Mar 2012
        • 53
        • 4.2.X

        #4
        Is it possible to just move the current attachment folder over to a location in the vb forums and access them that way? I have a ton of attachments on my site and would hate to lose them.

        Edit: I am hoping this might work once I change the VB setup to file system instead of database? Move the attachment folder over to the new vb forum?
        Last edited by RazorsEdge; Thu 15 Mar '12, 9:10am.

        Comment

        • RazorsEdge
          Member
          • Mar 2012
          • 53
          • 4.2.X

          #5
          Originally posted by RazorsEdge
          Is it possible to just move the current attachment folder over to a location in the vb forums and access them that way? I have a ton of attachments on my site and would hate to lose them.

          Edit: I am hoping this might work once I change the VB setup to file system instead of database? Move the attachment folder over to the new vb forum?
          Is it possible to do this?

          Comment

          • Trevor Hannant
            vBulletin Support
            • Aug 2002
            • 24361
            • 5.7.X

            #6
            Make sure you have a copy of the attachments folder on the same server as the vBulletin installation. Then try to import the attachments again making sure you use the full server path to the directory when prompted, not a relative path
            Vote for:

            - Admin Settable Paid Subscription Reminder Timeframe (vB6)
            - Add Admin ability to auto-subscribe users to specific channel(s) (vB6)

            Comment

            • RazorsEdge
              Member
              • Mar 2012
              • 53
              • 4.2.X

              #7
              Originally posted by Trevor Hannant
              Make sure you have a copy of the attachments folder on the same server as the vBulletin installation. Then try to import the attachments again making sure you use the full server path to the directory when prompted, not a relative path
              The import system began and had me excited until it reached this error.

              ImpEx Database error


              mysql error: Invalid SQL:
              INSERT INTO attachment
              (
              importattachmentid,
              filename,
              userid,
              dateline,
              counter,
              reportthreadid,
              caption,
              state,
              contentid,
              filedataid,
              contenttypeid,
              settings,
              displayorder
              )
              VALUES
              (
              '1846',
              'My pic\'s 170.jpg',
              '1908',
              '',
              '51',
              0,
              'My pic's 170.jpg',
              'visible',
              21169,
              1203,
              1,
              '',
              0
              )



              mysql error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's 170.jpg',
              'visible',
              21169,
              1203,
              1,
              '',
              0
              )' at line 25


              mysql error number: 1064


              Date: Monday 19th 2012f March 2012 10:09:17 PM
              Database: micompan_vbforum
              MySQL error:
              This happened during the second stage of attachment imports 1000 - 2000 attachment imports. Any insight as to what I am doing wrong?

              Comment

              • Jake Bunce
                Senior Member
                • Dec 2000
                • 46598
                • 3.6.x

                #8
                Looks like an ImpEx bug. Try editing this file:

                impex/ImpExDatabaseCore.php

                Add the red code:

                Code:
                		$Db_object->query("
                			INSERT INTO " . $tableprefix . "attachment
                			(
                				importattachmentid,
                				filename,
                				userid,
                				dateline,
                				counter,
                				reportthreadid,
                				caption,
                				state,
                				contentid,
                				filedataid,
                				contenttypeid,
                				settings,
                				displayorder
                			)
                			VALUES
                			(
                				'" . $this->get_value('mandatory', 'importattachmentid') . "',
                				'" . addslashes($this->get_value('mandatory', 'filename')) . "',
                				'" . intval($content['userid']) . "',
                				'" . $this->get_value('nonmandatory', 'dateline')  . "',
                				'" . $this->get_value('nonmandatory', 'counter')  . "',
                				0,
                				'" . [color=red]addslashes([/color]$caption[color=red])[/color] . "',
                				'" . $state . "',
                				" . intval($content['contentid'])  . ",
                				" . $filedataid . ",
                				$contenttypeid,
                				'" . addslashes($this->get_value('nonmandatory', 'settings')) . "',
                				" . intval($this->get_value('nonmandatory', 'displayorder')) . "
                			)
                		");

                Comment

                • RazorsEdge
                  Member
                  • Mar 2012
                  • 53
                  • 4.2.X

                  #9
                  Originally posted by Jake Bunce
                  Looks like an ImpEx bug. Try editing this file:

                  impex/ImpExDatabaseCore.php

                  Add the red code:

                  Code:
                          $Db_object->query("
                              INSERT INTO " . $tableprefix . "attachment
                              (
                                  importattachmentid,
                                  filename,
                                  userid,
                                  dateline,
                                  counter,
                                  reportthreadid,
                                  caption,
                                  state,
                                  contentid,
                                  filedataid,
                                  contenttypeid,
                                  settings,
                                  displayorder
                              )
                              VALUES
                              (
                                  '" . $this->get_value('mandatory', 'importattachmentid') . "',
                                  '" . addslashes($this->get_value('mandatory', 'filename')) . "',
                                  '" . intval($content['userid']) . "',
                                  '" . $this->get_value('nonmandatory', 'dateline')  . "',
                                  '" . $this->get_value('nonmandatory', 'counter')  . "',
                                  0,
                                  '" . [COLOR=red]addslashes([/COLOR]$caption[COLOR=red])[/COLOR] . "',
                                  '" . $state . "',
                                  " . intval($content['contentid'])  . ",
                                  " . $filedataid . ",
                                  $contenttypeid,
                                  '" . addslashes($this->get_value('nonmandatory', 'settings')) . "',
                                  " . intval($this->get_value('nonmandatory', 'displayorder')) . "
                              )
                          ");
                  Thanks! This fixed the problem of attachment import not finishing the operation. Thank you, I was able to import 2/3 of my attachments.

                  Comment

                  • RazorsEdge
                    Member
                    • Mar 2012
                    • 53
                    • 4.2.X

                    #10
                    I can not believe I am going to ask this, but I am in the process of doing this upgrade from smf to vb4 and go live, but I have failed to remember my full server path. I am using /public_html/forums/attachments but I am not getting anything except source file not found.

                    Comment

                    • RazorsEdge
                      Member
                      • Mar 2012
                      • 53
                      • 4.2.X

                      #11
                      Ok, My brain fart has gone away and I figured out what I was doing wrong with the server path. My only problem occurs during the import and I get this error.

                      Code:
                      WHERE filedataid = 151
                      					
                      
                      
                      mysql error: Got a packet bigger than 'max_allowed_packet' bytes
                      
                      
                      mysql error number: 1153
                      
                      
                      Date: Friday 11th 2012f May 2012 11:05:34 PM
                      Database: micompan_vbforum
                      MySQL error:
                      Any ideas?

                      Comment

                      • Zachery
                        Former vBulletin Support
                        • Jul 2002
                        • 59097

                        #12
                        Going to need to ask your webhost to up the max_allowed_packet

                        Comment

                        • RazorsEdge
                          Member
                          • Mar 2012
                          • 53
                          • 4.2.X

                          #13
                          Originally posted by Zachery
                          Going to need to ask your webhost to up the max_allowed_packet
                          Is this max allowed packet for the MySql database? I did not have this problem in all my test runs with a demo setup using the backup database.

                          Comment

                          • RazorsEdge
                            Member
                            • Mar 2012
                            • 53
                            • 4.2.X

                            #14
                            Ok, My host increased the max_allowed_packet and I restarted the import when I received this error during the attachments import.

                            Code:
                            [B]Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 75672839 bytes) in[B]/home/micompan/public_html/vbforum/impex/ImpExDatabaseCore.php on line [B]1749
                            [/B][/B][/B]



                            Any ideas for this one?

                            Comment

                            • Lynne
                              Former vBulletin Support
                              • Oct 2004
                              • 26255

                              #15
                              That is another server error that you will need to show to your host so they can fix it.

                              Please don't PM or VM me for support - I only help out in the threads.
                              vBulletin Manual & vBulletin 4.0 Code Documentation (API)
                              Want help modifying your vbulletin forum? Head on over to vbulletin.org
                              If I post CSS and you don't know where it goes, throw it into the additional.css template.

                              W3Schools <- awesome site for html/css help

                              Comment

                              widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                              Working...