Jump to content

Copy Shopdata: Script for upgrading and fixing buggy shops by copying business data and images


Recommended Posts

After writing copy_shopdata.php these errors:

1 accessory 38
Fatal error: Uncaught mysqli_sql_exception: SELECT command denied to user 'db109971xnova'@'10.10.51.16' for table `db109971xbiopla`.`ps_accessory` in /www/b/i/u109971/public_html/admin500bwd3vsijqzrprxtm/Prestools_Suite/copy_shopdata_functions.inc.php:7 Stack trace: #0 /www/b/i/u109971/public_html/admin500bwd3vsijqzrprxtm/Prestools_Suite/copy_shopdata_functions.inc.php(7): mysqli_query(Object(mysqli), 'INSERT INTO `db...') #1 /www/b/i/u109971/public_html/admin500bwd3vsijqzrprxtm/Prestools_Suite/copy_shopdata_functions.inc.php(587): dbxquery(Object(mysqli), 'INSERT INTO `db...') #2 /www/b/i/u109971/public_html/admin500bwd3vsijqzrprxtm/Prestools_Suite/copy_shopdata_functions.inc.php(458): copy_table_direct('accessory', 'ps_', '`id_product_1`,...', Array) #3 /www/b/i/u109971/public_html/admin500bwd3vsijqzrprxtm/Prestools_Suite/copy_shopdata.php(228): copy_table('accessory') #4 {main} thrown in /www/b/i/u109971/public_html/admin500bwd3vsijqzrprxtm/Prestools_Suite/copy_shopdata_functions.inc.php on line 7

Link to comment
Share on other sites

Quote

denied to user 'db109971xnova'@'10.10.51.16' for table `db109971xbiopla`.`ps_accessory`

as your MySQL root you must grant permissions via something like (this is too wide for real life):

grant all on `db109971xbiopla`.* to 'db109971xnova'@'10.10.51.16' 

                                                                                                                                        

Link to comment
Share on other sites

Rights problems usually happen when copying from one mysql installation to another. I don't have a solution for that, except for the suggestion to copy the database to the target installation and use that as the basis for copy_shopdata,

Link to comment
Share on other sites

  • 4 weeks later...

We are about to try upgrading an old 1.6.1.24 Prestashop version using your script. We tried with 1 click upgrade but it doesn't work.

Would you recommend we try and do a fresh installation of the same Prestashop version, transfer tables, and try again with 1-click or can we go straight from 1.6 to 8.1 (or 1.7)?

Edited by gregor5 (see edit history)
Link to comment
Share on other sites

2 hours ago, gregor5 said:

can we go straight from 1.6 to 8.1 (or 1.7)?

You cannot, you need to go step by step thru the entire tree.
Why do you wish to update. No themes you like? Do clients complain about the optic? 

Most shops look alike when opened with a mobile phone.

Link to comment
Share on other sites

4 hours ago, gregor5 said:

We are about to try upgrading an old 1.6.1.24 Prestashop version using your script. We tried with 1 click upgrade but it doesn't work.

Would you recommend we try and do a fresh installation of the same Prestashop version, transfer tables, and try again with 1-click or can we go straight from 1.6 to 8.1 (or 1.7)?

I would suggest a fresh 8.1 installation and then going straight from the old shop to that version.

Let me know when you notice any problem.

Link to comment
Share on other sites

  • 3 weeks later...
  • 3 weeks later...

Good morning,

I'm trying to use copy_data, but something here is malfunctioning.
Presta 8.1.7 on the same server and different folders, different DBs.

I just need to transfer the customers, addresses and orders, but I get this error:

SELECT command denied to user 'xxxx_xxxxxx'@'localhost' for table `xxxx_xxxxxx1`.`ps_address`

MySQL error 1142: SELECT command denied to user 'xxxx_xxxxxx'@'localhost' for table `xxxx_xxxxxx1`.`ps_address`

 

Any suggestions?

Link to comment
Share on other sites

It looks like those databases have different logins and that gives problems.

If that is the case you have two options:

 - you can copy one of the databases or allocate rights so that both can be reached with the same server-user-password combination

 - you can set the $copy_method variable to row. But that will make the process much slower.

Link to comment
Share on other sites

16 minutes ago, musicmaster said:

It looks like those databases have different logins and that gives problems.

If that is the case you have two options:

 - you can copy one of the databases or allocate rights so that both can be reached with the same server-user-password combination

 - you can set the $copy_method variable to row. But that will make the process much slower.

So what it tells me is that I have to put the old database with the same user and pass as the new database, right?

Link to comment
Share on other sites

  • 2 weeks later...

HI,

 

I am trying to update a 1.6.1.24 to 8.2.  I have a problem when the script find a NULL.  I have downloaded latest version of copydata.

Column 'color' cannot be null

MySQL error 1048: Column 'color' cannot be null
Generated by URL '/Backoffice/herramientas/copy_shopdata.php'
with Query 'INSERT INTO `ps_8`.`ps_attribute` (`id_attribute`,`id_attribute_group`,`color`,`position`) VALUES ('51','10',NULL,'42')'

May someone help me, please? 

 

Link to comment
Share on other sites

  

Hello Ipaelo

replace NULL with '#eee' or any color RGB u want .

INSERT INTO `ps_attribute` (`id_attribute`, `id_attribute_group`, `color`, `position`) VALUES ('51', '10', '#FFFFFF', '42');

 

other option is trying to update the color field so then u make it accepting NULL

ALTER TABLE `ps_attribute` MODIFY `color` VARCHAR(255) NULL;

set a default atttribute :
 

ALTER TABLE `ps_attribute` MODIFY `color` VARCHAR(255) NOT NULL DEFAULT '#000000';

and try your script again:

 'INSERT INTO `ps_8`.`ps_attribute` (`id_attribute`,`id_attribute_group`,`color`,`position`) VALUES ('51','10',NULL,'42')'

 

saludos

jose lorenzini

  • Thanks 1
Link to comment
Share on other sites

On 11/19/2024 at 2:07 PM, ipaelo said:

 

I am trying to update a 1.6.1.24 to 8.2.

you should have updated step by step.
Or alternatively create a new shop in the version you wish to use.

Link to comment
Share on other sites

On 11/19/2024 at 3:07 PM, ipaelo said:

HI,

 

I am trying to update a 1.6.1.24 to 8.2.  I have a problem when the script find a NULL.  I have downloaded latest version of copydata.

Column 'color' cannot be null

MySQL error 1048: Column 'color' cannot be null
Generated by URL '/Backoffice/herramientas/copy_shopdata.php'
with Query 'INSERT INTO `ps_8`.`ps_attribute` (`id_attribute`,`id_attribute_group`,`color`,`position`) VALUES ('51','10',NULL,'42')'

May someone help me, please?

It works for me: NULL is automatically converted into an empty string. It looks like your database has stricter settings. Maybe it is a Mysql vs. MariaDB difference.

Edit: There is now a new version of the package that you can download

 

Edited by musicmaster (see edit history)
  • Like 1
Link to comment
Share on other sites

Hi Musicmaster, my old prestashop was infected by a malware on TinyMCE plugin and I cannot get into admin... I installed a fresh new prestashop and I want to get the products and other pages and info from the old database... is that possible with your tool??? can you help me??

Link to comment
Share on other sites

2 hours ago, Renato Strafatta said:

Hi Musicmaster, my old prestashop was infected by a malware on TinyMCE plugin and I cannot get into admin... I installed a fresh new prestashop and I want to get the products and other pages and info from the old database... is that possible with your tool??? can you help me??

Yes, that is possible. You only need to fill in the database credentials in the config file.

You can use Copy_shopdata_imghub.php to copy the image directory.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...