It’s possible, but not directly. You will need to write one or more scripts that convert the old database information to the new database format.
A tool that helps a lot in this process is WP-CLI, which allows you to write the scripts in PHP itself, using native Wordpress methods, and run on the command line, avoiding common timeouts and memory problems in the browser. The process is usually as follows:
- Plan in detail the structure of the new bank, where each existing information goes. In this step it is common to even decide which Infos will be imported and which will not.
- Study the original database and separate the data into large groups according to what they will be on the new site. It is common to note where in the original bank the information that will be transformed into taxonomies, authors, post types, meta values and options.
- Implement the codes needed to form the complete structure of the new site, so you already have a ready-to-test base when you finish importing. This step is very important to be done before importing because during development you will see details that are difficult to notice just by looking at the bank, for example, if a certain information serves you better as taxonomy or as meta-value, according to how it will be used. Once the new structure is ready, with test contents, you know that the structure suits you so just shoot.
- Write the CLI scripts that you will read from the original bank and save to the new bank. At this point you use the WP-CLI to import using the original WP methods, so that incidental data (such as image meta-data, or post-date-gmt, for example) is automatically generated and you do not need to do it by hand.
- Import the information in that order: authors (users) > taxonomies > media > posts + meta > settings + options. You need the taxonomies in place to attach the posts when they come in. And you need the images too, so the posts can read from them.
I think the basic thing is this. Then you will adapt the steps to your project.
Exite, refactoring the database adapting the tables and columns to those of wordpress, but it is nothing simple, since the databases can be created in very specific ways.
– Erlon Charles