Jump to content

erro with migrate from another database to prestashop

Abo Anas

Recommended Posts

Hello All :

many thanks in advance for who help or trying

i have system{ not prestashop system but its made individually } that contain customers and categories and subcategories and products now i try to go to presta and migrate database i did script to get fields from old database to the prestashop like

in category tables 

$sql="insert into {$this->pprefex}category (id_parent, id_shop_default, level_depth, nleft, nright, active, date_add, date_upd, `position`, is_root_category) values (2, 1, 2, 2, 2, 1, '{$create_time}','{$update_time}', 0, 1)";

$sql="insert into {$this->pprefex}category_lang values ({$newcust}, 1, 1, '{$name_en}', '', '', '', '', '')";

BTW im using the primary keys ids from the old system

in its get inserted successfully

but when  i try to edit the the category it gives me

The object cannot be loaded (or found)

thats in all inserted data product / customers / categories

can anyone tell me what i missed while inserting data ?



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

On 6/23/2020 at 5:17 PM, ndiaga said:


Why  not  using  a  CVS   file?

Put  your  old  data in a   CSV   file  and  match   the  fields  accordingly  there  you  can use    the   default  import    feature.

Also  you  need  to  create  Objects one  by  one :   Categories  then  Products  then  Customers.

thank you tha's very good solution but it cant help in my situation as i need to make changes in the primary key using code before insert

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...