Skip Navigation

[Resolved] How to import relationships with Toolset

This support ticket is created 4 years, 10 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 9 replies, has 2 voices.

Last updated by Beda 4 years, 9 months ago.

Assisted by: Beda.

Author
Posts
#1550201

This is the continuation of https://toolset.com/forums/topic/missing-records-after-csv-import-into-intermediary-post-type/ – since I am not allowed to post my answer there I do it here.

--------

This is the database after the import. Unfortunately, I did not backup the database before the import, so the database before the import does no longer exist.

Maybe my wording was misleading. I did not import data directly into an intermediary post type, so I should rather say: I have imported data from a many-to-many relationship which should create these 4'000 intermediary posts as a result. The import file contains records of the custom post type «Marken», including the related «Firmen» post IDs from the many-to-many relationship «Vertriebe».

So it basically follows this example:

https://toolset.com/documentation/user-guides/export-import/how-to-import-content-into-wordpress-using-csv/how-to-import-data-from-a-csv-file-using-the-wp-all-import-toolset-types-add-on-plugin/post-relationships/

New threads created by Beda and linked to this one are listed below:

https://toolset.com/forums/topic/how-to-import-relationships-with-toolset/

#1550489

If you do not have the previous database anymore, and the new database (hence the only data now available) has missing entries, the only way to regain those entries is by either adding them manually or re-attempting any import (in case the data is still somewhere in a CSV file for example)

You would need to determine which data is missing, so to know why precisely why it is not added in the import.

If the data is in the CSV stored precisely like the data that was successfully imported (it was the same import as I understand) then there is no reason it should not be imported.
Hence, the data not imported (missing entries) must have some difference to the data successfully imported

That difference needs to be located, amended and corrected.
Then it would work, I assume, as the other data also successfully imported

One other reason for missing entries can be timeouts, disconnections or else

In both cases though, Toolset Support or Plugin cannot help recover the data.
It could help to import it, depending on what you import (sometimes paid third-party plugins will be necessary).

About the other ticket you link to, I think Christian mentions already that Intermediary Post Types (which are part of an M2M relationship) is not supported.

I also see the import was likely not done by those recommendations as you mention in the comment above, because I recall there was already a blocking issue here https://toolset.com/forums/topic/how-to-import-data-from-a-database-with-m-n-relationships/#post-1505905
As I understand the import was not possible, with the method chosen, and a custom suggested way was picked, which we do not document nor support

So, I am not sure how we can help at this point.

If the database is lost, there is no way to recover that data, unfortunately.
Unless, you have it in some CSV or else, and are sure it's the format is correct, and it is supported to import.
Since part of the data seems to have worked, the issue will be easy to spot by defining the difference to the data not imported.

That would then allow for further steps or suggestions on how to proceed.

#1556601

Let's not worry about the data: Since I am importing my data from another database, I can always delete all records in my WordPress database and start the import process all over again. This is not the issue.

It's important to understand that we are talking of just ONE import, not TWO. And you can check the corresponding CSV file here: https://toolset.com/forums/topic/missing-records-after-csv-import-into-intermediary-post-type/. Importing this file should result in roughly 4'000 records in «Vertriebe», but only half of them were created. So this does not make any sense.

The second thing that does not make sense is that Toolset tells me that 2000 existing associations need to be updated, but updates only 50. You can find the details here: https://toolset.com/forums/topic/missing-records-after-csv-import-into-intermediary-post-type/

#1557079

I have to ask again, what is the difference between the posts imported, and those not imported.

Can you locate a post hat is in the CSV, and make sure it was not imported, and check the entry in the CSV against one that was Imported?
There must be a difference. If there is not, then the CSV is not the source of the issue but the import process is.
For example, something could abort the import, or similar.

Christian also already analysed that file and says https://toolset.com/forums/topic/missing-records-after-csv-import-into-intermediary-post-type/#post-1528781, that the formats are not according to the DOC
Can you amend this and try again?

The CSV does not seem to be formatted as required. It does not seem to be created with the documented import features in mind.

For the second issue, I suggest opening a new ticket (one issue per ticket) after the CSV is created with the DOC examples in mind and the import is re-tested with that.

#1566457

Based on the sample I was able to analyze I would say that
– whenever a post had just 1 associated post, then the import worked
– whenever a post had more than 1 associated post, then the import did not work (in this case not even the first associated post was created)

If you think that my CSV was not formatted as required then I would appreciate if you could provide an example of the correct formatting.

The formatting of my CSV file is as follows:
intPkBrands;vchrBrand;MarkenPostID;FirmenPostIDs
(Ignore the intPkBrands part, that's simply a reference to our old database.)

Importing this row worked fine:
11;Academy;3510;7281

Importing this row did not work:
12;Access;3511;7300,8831,9370

So how should this row look like?

#1566463

Examples are provided here:
https://toolset.com/documentation/user-guides/export-import/importing-content-from-csv-with-post-relationships/#an-example-of-how-a-csv-would-look-like
https://toolset.com/documentation/user-guides/export-import/importing-content-from-csv-with-post-relationships/#how-toolset-associations-can-be-added-to-a-csv

Your CSV is not formatted like you state, please check it here:
hidden link

It is a mix of [string], (string), spaces, and I see nowhere the suggested syntax from https://toolset.com/documentation/user-guides/export-import/importing-content-from-csv-with-post-relationships/

I see you closed this ticket already, hence I suspect you managed to resolve the issue?

If not, please open a new ticket if required.

Thanks!

#1566465

Hi Beda

I would really appreciate if you could give me just one single example and not just send me links to your documentation which I obviously misunderstand.

And no, I did not close this ticket, it's your ticketing system which does this automatically if I am not able to answer quickly enough.

#1566477

This is what this doc is here for, exactly to avoid the need to craft an example CSV to copy from

I actually suggest you express your concerns about this doc directly at https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset, so they can amend it according to user experience and not our technical-background

I attach here examples for custom fields and repeatable group fields
Sample CSV hidden link
Sample Fields to import to Toolset for above sample data to take place hidden link

I will now prepare another CSV with post relationships, this will take a while.
I would like to emphasize to please suggest changes to that DOC in the link provided, this will help in future to make it clearer.

#1566487

OK so, you have started on a thread that I handled, but there I recommended the Process here https://toolset.com/documentation/user-guides/export-import/how-to-import-content-into-wordpress-using-csv/how-to-import-data-from-a-csv-file-using-the-wp-all-import-toolset-types-add-on-plugin/post-relationships/, not here https://toolset.com/documentation/user-guides/export-import/importing-content-from-csv-with-post-relationships/#an-example-of-how-a-csv-would-look-like

These are 2 different (completely different) things.
They all import data but one is with a plugin, the other is creating custom CSV manually

Which way did you go?
For the All Import way, we have several examples on the DOC https://toolset.com/documentation/user-guides/export-import/how-to-import-content-into-wordpress-using-csv/how-to-import-data-from-a-csv-file-using-the-wp-all-import-toolset-types-add-on-plugin/post-relationships/

For the CSV File one (which I did not elaborate on the other tickets) I would need to craft some first.

Which do you use?

#1566507