Import bank WordPress

0

Good afternoon, there is a way to import a database from a website that was not made in WordPress for a new website made in WordPress?

    
asked by anonymous 16.02.2017 / 20:25

1 answer

1

It is possible but not directly. You will need to write one or more scripts that convert information from the old bank to the new bank format.

A tool that helps a lot in this process is WP-CLI , which allows you to write the scripts in PHP yourself, using the methods native to WordPress, and run on the command line, avoiding timeouts and common 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 ones will not.
  • Study the original bank and separate the data into large groups according to what they will be in the new site. It is common to note where the information that will be transformed into taxonomies , authors , post types strong> and options .
  • Implement the necessary codes to form the complete structure of the new site, so that you already have a ready base to test when the import is finished. This step is very important to be done before import because during development you will see details that are difficult to understand just from 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 will answer you, so just send a bullet.
  • Write the CLI scripts that will read from the original bank and save it to the new bank. At this point you use WP-CLI to do the import using WP's original methods, so that the incidental data (such as meta data, or post-date-gmt, for example) is generated automatically and you do not need to do in hand.
  • Import the information in this order: authors (users) > taxonomies > media > posts + meta > settings + options . You need the taxonomies in place to attach the posts when they enter. And you need the images too, so the posts can read them.
  • I think the basics are this. You will then adapt the steps for your project.

        
    17.02.2017 / 12:00