Skip Navigation

[Resolved] How can I migrate from a custom m2m design to wp design?

This thread is resolved. Here is a description of the problem and solution.

Problem:

The customer needed to migrate a custom many-to-many (m2m) database setup, with separate tables for articles, writers, and their relationship, into WordPress using Toolset. They sought guidance for this process, particularly for handling m2m relationships, as available tutorials primarily covered one-to-many (o2m) relationships.

Solution:

The migration to a WordPress-compatible many-to-many structure with Toolset involves several steps:

1- Create Custom Post Types: Using Toolset, set up custom post types for "Articles" and "Writers" to match the existing data structure.

2- Establish the Many-to-Many Relationship: Toolset supports defining many-to-many relationships directly between custom post types. An intermediary relationship can link "Articles" and "Writers," reflecting the original database’s structure.

3- Prepare Data for Import: Export the current data tables (articles, writers, and articleswriters) as CSV files to facilitate data import.

4- Use a CSV Import Plugin: With a plugin like WP All Import, map the data into the respective custom post types in WordPress, and ensure the relationships between articles and writers are accurately represented.

5- Display and Manage Content: Toolset enables the creation of front-end templates for displaying the articles and writers, showcasing their relationships.

Relevant Documentation:

https://toolset.com/documentation/programmer-reference/how-to-import-a-database-into-wordpress/

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
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Sao_Paulo (GMT-03:00)

This topic contains 1 reply, has 2 voices.

Last updated by Mateus Getulio 2 months ago.

Assisted by: Mateus Getulio.

Author
Posts
#2778209

I have a custom db with articles and writers that have m2m relationship. I have 3 tables: 1)articles, 2)writers and 3) articleswriters with their ids. Is there any tutorial in order to do the convertion? I have seen this hidden link
but it's for o2m relationship. I would appreciate your help! Thanks in advance!

Evi

#2778230

Mateus Getulio
Supporter

Languages: English (English )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello Evi,

Thank you for reaching out! For your many-to-many relationship between articles and writers, Toolset can handle this using relationships between custom post types. The guide you found is for one-to-many relationships, but the process is similar for many-to-many.

Here’s a helpful tutorial on migrating custom databases into WordPress using Toolset:
https://toolset.com/documentation/programmer-reference/how-to-import-a-database-into-wordpress/

In the article above, you'll see step-by-step how to:

1. Create custom post types: You’ll set up a custom post type for both articles and writers using Toolset.

2. Set up the many-to-many relationship: Toolset allows you to define many-to-many relationships between custom post types. In your case, you can link articles and writers through an intermediary relationship.

3. Import your data: Once the structure is ready, you can export your current database tables (articles, writers, and the relationship table) into CSV files.

4. Import the CSV files into WordPress: Using a CSV import plugin (such as WP All Import), you can map the data into your newly created post types and establish the relationships between articles and writers.

5. Display and manage content: After the import, Toolset will help you create templates to display your content and manage the relationships on the front end.

Feel free to reach out if you have any questions or need further assistance.

Best regards,
Mateus