Migrating from v2.0.0a to 1.5.9


#1

When trying to use the migration tool, we get the following error:

The tool is ready to convert the database now.

Warning : mysqli_fetch_row() expects parameter 1 to be mysqli_result, boolean given in /home/scoticf/public_html/migration/engine/convert_db.php on line 26

Warning : mysqli_fetch_row() expects parameter 1 to be mysqli_result, boolean given in /home/scoticf/public_html/migration/engine/convert_db.php on line 68

Error! An error occurred while resetting the versions!

Is there something we are doing wrong?

Your guidance would be appreciated.


#2

I missed where you got that migration to from? The error is that your result is not complete. It either could not find any rows or something else is wrong.
We have to look into the took to give you better message, or to see how you get rows from the database instead of empty result


#3

The migration tool was downloaded from the site here. (https://wiki.invoiceplane.com/en/1.5/system/upgrade-from-fusioninvoice)

The database is fully populated and we have backed up the live db. Can send you the .sql file if that helps?


#4

I’ll let you know if I need it. Thanks for the link man :blush:


#5

The hint might be in that error message/If your connection fails, the connect will return false (a boolean). This is being passed to the fetch_row() function.

Please ensure you are connecting successfully. I would suggest you add the following code after the mysqli_connect() statement and the

    $connection = mysqli_connect(
        $_SESSION['connection']['host'],
        $_SESSION['connection']['user'],
        $_SESSION['connection']['password'],
        $_SESSION['connection']['name']
    );

    if (mysqli_connect_errno()) { 
        die("Database connection failed (Error no  ". mysqli_connect_errno(). " ) : ". mysqli_connect_error());
    }

#6

Still getting the error message:

The tool is ready to convert the database now.

Warning : mysqli_fetch_row() expects parameter 1 to be mysqli_result, boolean given in /home/scoticf/public_html/migration/engine/convert_db.php on line 30

Warning : mysqli_fetch_row() expects parameter 1 to be mysqli_result, boolean given in /home/scoticf/public_html/migration/engine/convert_db.php on line 72

Error! An error occurred while resetting the versions!

despite adding the as suggested,


#7

I’ll take a look at it tomorrow morning


#8

Eish. I was hoping that would catch the error. This means that your connection was successful. Move to the next possible culprit - the query. You can see what the actual error is. Try the following change that will display any errors with the query.

Change
$result = mysqli_query($connection, $query);

to

 $result = mysqli_query($connection, $query);
 if ($result === false) {
      echo "error while executing mysql: " . mysqli_error($connection);
      die();
 }

`


#9

Its now throwing up this error:

error while executing mysql: Table ‘ip_client_custom’ already exists


#10

I realised there was some entries in the DB from a previous install of IP. I removed all the “ip_” tables and reran the migration tool. Now I get this message:

The tool is ready to convert the database now.

Warning : mysqli_fetch_row() expects parameter 1 to be mysqli_result, boolean given in /home/scoticf/public_html/migration/engine/convert_db.php on line 76

Error! An error occurred while resetting the versions!


#11

What I have noticed is that the migration tool renames the tables but misses off the beginning so for eg

attachments

becomes

ip_achments


#12

It’s a little but tricky to solve. The tables get renamed, but most likely there are already tables in that database with that name.
Every error like this: mysqli_fetch_row() expects parameter 1 to be mysqli_result, boolean given needs to be handled like this:
$result = mysqli_query($connection, $query); if ($result === false) { echo "error while executing mysql: " . mysqli_error($connection); die(); }
Without the real errors you can’t really debug that conversion.
Are you trying to do the conversion in the same database?
Can you see where the renaming of the tables take place?


#13

This line

$new_name = 'ip_'.$new_name;

Just change the prefix, to something like

    $new_name = 'ipv2_'.$new_name;