Jump to content

Importing orders directly in the database


saeyo

Recommended Posts

Hey guys,

 

This is my second topic, second issue I've had with Prestashop in trying to migrate to 1.7.2 from a proprietary system in production for 8 years with thousands of orders. All of those have been fulfilled and we want to migrate them so users can see their purchase history when they login.

 

I understand there is no way to import orders in Prestashop via .csv. Module, I don't know?

 

Saw some that are meant to export, not import. I saw Store Commander might do it, but it woulds be something $400 to buy it and my client has around $1000 for every module we need, so I feel bad spending half of the money on just one plugin. Plus, it would suck to buy the module just for that specific thing.

 

So I'm wondering if there is any way to do it manually and inject orders (with all the order details) in the database via SQL. Is it really impossible?

 

thanks

Link to comment
Share on other sites

I fully agree with tuk66's opinion. I roughly counted 28 tables which deal with orders in some way. Some might not be needed, for example those who store payments details. Overall I would guess you need some 5 to 10 tables only for a quite basic functionality. If I would be asked to make a guess I wouln't estimate less than a week to do it on my own.

 

So the question remains: are you capable to do it on your own within reasonable time and does it cost less than the modules price of $400 ??

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

Hey guys,

 

thanks for your answers!

 

To be honest, the orders are all fulfilled, so it's really a matter of being able to show the client their previous orders history. It doesn't have to be linked to everything else.

 

If this is not possible and my "client" doesn't want to spend the money, we'll maybe just put a sentence on imported customers saying "don't see your history? email us to fix it" and then we'll manually add their orders, unless it's impossible to add order with an old date.

Link to comment
Share on other sites

  • 3 years later...
  • 5 months later...
On 8/18/2021 at 6:29 AM, Henrik41 said:

By the time I migrated the site and upgraded the site to a new server the initial website had more orders. Therefore if someone has the list of the tables that get updated when there is an order then it would be super useful. 

 

 

Search copy shop data for this.

 

For the import of orders via CSV, we are interested in finding as module or script for this too. We have a number of pre orders placed by google form submission which we now need to process into orders, or at least carts, for the customer to process.

I see we have two options here:

CSV import to a cart for the customer to process.

Or

CSV import an order for each customer set to awaiting payment. (we have a module that allows them to pay for orders in their order history page).

 

Can anyone recommend a module for importing orders by CSV?

 

The third option is to manually sit and create orders in the back office, but this would take too many man hours with around 1000 orders to process.

Link to comment
Share on other sites

  • 2 months later...

Hi all!

I'm gonna ask this aproaching from  different angle.

I have a live instance and a development instance. which are identical (except for some features being worked on the dev instance).

Live instance receives orders where as the dev env "falls behind" with new orders. customers etc.

I want to "update" the dev instance with recent order etc data every now and then.

Is there a complete list of which tables I need to update to get the desired outcome?

Some CMS related tables, *.tpl files etc might have changes in the dev which I don't want to lose, but I can easily drop all tables related to "dynamic" data related to orders/customers/etc and then restore them from a fresh dump taken from the live instancve's DB.

 

Link to comment
Share on other sites

Import via SQL is suicide.
Prestashop contains many functions for creating customers, addresses, orders, special prices, etc.
Everything must be paired correctly, otherwise the whole e-shop may become inoperable.
If you are looking for something to save and damage the e-shop, I would not want to be your customer.

SQL no, never.
Do you require a list of tables?

Everything you write down is in ./classes or ./controllers.

In one case, writing to 5 database tables may be sufficient, but in another case, writing to 10 database tables may be required.

The development of a module for importing orders is not easy and it is not possible to advise what and how.

The explanation would be for a few days.

Yes, custom module development would really take a few days.

Link to comment
Share on other sites

I get the principle yes, but our development instance is deployed often enough that I can trust it is identical enough for this to be safe. 

 

Moreover, I am NOT trying to export to production, but always from production to the development. So the worst case scenario that can happen, is that the development gets effed up, in which case I can just delete that instance and clone a new dev instance from the live instance again. So breaking something is not that fatal.

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