How to migrate from a custom database into WordPress

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
suppose you have this website a hartwill catalog which has machines and manufacturers and now you'd like to make great this catalog into WordPress and you want to keep the exact same content structure that you have today you also need convenient editing screens for different types of content and finally you want to quickly display your content any way you choose in people's greets little filters etc doesn't sound like a complex task yes it does but as soon as you use the right WordPress plugins it becomes easy hello my name is Agnes and in this video I'm gonna guide you through the immigration process you will learn how to setup your WordPress structures to reflect your current database schema including post relationships how to export and then import your data into WordPress through the CSV files and how to approach creating templates for displaying your data on the front-end without using PHP so let's get started let's start with a fresh copy of WordPress by default we only have posts and pages in our custom database however we have machines and manufacturers each being represented by a set of different values so to store all these values we need something more advanced than just regular wordpress post and pages fortunately WordPress allows us to create custom post types and define the so called custom fields but here's the challenge WordPress will use only two tables to store all that extra stuff these are posts and post meta tables and the question is how would you map your mesh and manufacture tables into these two mysterious wordpress tables and here's the solution let the plugin do the dirty work for you so first we are going to use that tool set types plugin and create a new post type for each of our tables so we create the Machine post type to store the machines and the manufacturer post type to store the machine makers now we are going to add fields to dispose types and the fields will represent the columns in our tables you create a group of fields and you add your fields let's add color as a single line field which is basically a text field and the net weight as a numeric field so I'm gonna choose number the process of creating fields is pretty straightforward and you just need to do the same for all other fields of your database once we are done in your WordPress you should see two new pulse types machines and manufacturers with a bunch of custom fields each okay the basic structures look pretty good but there is one more thing to handle of your custom tables will have connections in our example manufacturers are connected with machines stay with me to see how is the tab post-relationship in Tulsa so in our example a given machine can be made by only one manufacturer but a given manufacturer can make many machines so we need to establish the so called one-to-many relationship into that it's easy you go to to set relationships and create a new relationship between your pulse types manufacturers and machines in our case and that's it now our per site has all the structures to store your data obviously you can go and insert your data manually but if you have lots of data certainly that's not an option stay with me to learn how to speed up the process by using the CSV files to move your content from custom tables into WordPress we need to take two steps first we need to export the tables into CSV files and then import data from the CSV files into WordPress to handle the export part we are gonna use the PHP my admin tool and to import the data we'll use some wordpress plugins let's handle the expert part first to access our source database you need to log in into the PHP my admin tool and in the designer tab you will see your database structure but PHP myadmin also allows you to run an SQL query and save the results in a CSV file so let's use it first we are going to export the manufacturers so we switch to the SQL tab and we are going to select all records and columns except the inner ID let's run the query okay it looks good so now we just need to export the results you click export select CSV and in custom settings will check column name so these are exported as well ok the files ready and looks as expected now we are gonna do the same with machines but this time we'll slightly modify a query to replace their manufacturer ID with the full name to access the manufacturer full name we need to join the machines tables with the manufacturers tables using full names will help us later on to establish the correct relation when we'll be importing their CSV files into WordPress the results look as expected so we can proceed with the export let's check the file this one looks good as well and now we are ready to import the files into our wordpress stay with me to see the best wordpress plugin for importing CSV files into WordPress to import a CSV files will use the WP or import plugin you can download in from the wordpress wrapper you also need that tool set types are own to handle types custom fields and make the connections between your posts let's start with manufacturers you go to all import start a new import and you upload your file select your pulse type manufacturers in our case and here in step three you map fields simply drag and drop the call names into appropriate wordpress fields you you okay few more steps and once the input process is finished you should see all your manufacturer post in your site the migration of the Machine post works pretty much the same but in addition we need to connect machines with existing manufacturers for this we'll use the relationship section where we put the manufacturer name as the connector okay all the records have been successfully imported and if you visit a single machine now you will see that the connection with the corresponding manufacturer has been created so we have structures the relationships and now all the data in our WordPress now it's time to display the data on the front-end if you stay with me for a couple of more minutes you'll see how to approach creating templates without using PHP typically you'll need the following templates for your wordpress site templates for single items this would be single machine and single manufacturer templates in our case archive pages consider these as a kind of index of all posts that belongs to a certain post type and different list of items lists are similar to archives that list can appear anywhere in your site in regular pages sidebars or even this can be part of your other templates both lists and archives might include filters the great news is that you can create all these templates directly from your WordPress admin without using PHP if you use tools at plugins you'll need the tools that views plug-in and if you are the drag and drop approach fan you can also use the toolset layouts plug-in or even one of the page builders tools that is integrated with but for this video let's stick to the 2/3 views online now let me show you how quickly you can display a list of machines in a table we are going to create a view for machines and let's use the loop wizard we select the table and on this screen we decide which machine fields will be displayed in a single loop iteration which is basically a table row in our case so we are adding different machine fields but you can even choose fields from other tables tables that are connected by post relationships and it will be machine manufacturer in our case and that's it our view is ready let's preview it by creating a draft page that will include it okay the table looks pretty good naturally you can customize it further if you want creating all other kinds of templates in toolset is just as easy and moreover you can even create fronting forms in case you need as simplified editing interface for your project oh that was long but as you can see me creating your existing side and custom tables into WordPress isn't that difficult especially if you split your work into small chunks and use the right tools to sum up use the PHP my admin tool CSV files and the WP or import plugins to migrate your tables into WordPress and to search plugins will take care of the content structure post relationships and the front-end display I hope you enjoyed the video thank you very much for watching
Info
Channel: Toolset
Views: 36,733
Rating: undefined out of 5
Keywords: WordPress, migration, CSV
Id: 2PIChT5T0oQ
Channel Id: undefined
Length: 14min 10sec (850 seconds)
Published: Wed Oct 10 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.