Import Wordpress bank

Asked

Viewed 89 times

0

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

  • 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.

1 answer

1

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:

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.