How to choose among three methods: Excel, compressed package, and interface for batch importing articles

There are three different routes for batch importing articles, not the same size and function, but three different divisions of responsibility: Excel puts the field caliber in your hands, ZIP puts the media and naming rules in your hands, and the import interface puts duplicate checking, batch processing, and error retries in your hands. AnQiCMS supports two batch import methods, ZIP compressed packages and Excel spreadsheets, and also provides a document content import interface /api/import/archive, supporting title-based queries to check if the manuscript already exists. First, take a look at the appearance of your content and then decide which route to take.

What each of the three methods is good at

Route The most suitable form of content Things that must be prepared in advance Main risk
Excel spreadsheet Pure text copy, well-organized existing articles Column names and classification identifiers consistent with the system Rich text flattened, long paragraphs with missing line breaks
ZIP compression package Collection of articles with pictures and attachments Stable directory structure and file naming Missing image paths, files with the same name covering each other
Import Interface Programmatic migration, requiring duplicate checking and batch retrying Call credential and field mapping table Batch interruption leads to semi-migration and repeated submission

One-sentence selection method: If the content does not have media files, go with the table; if there are many media files and complex directory relationships, go with the compressed package; if you need to migrate and verify while migrating, or the amount of migration needs to be controlled by scripts, go with the interface.

First define the field specification, then select the import method

If the field specification is not defined, start working, which is the main source of import rework. The following three things must be done first: column attribution (which category each article falls into), tag rules (whether tags are automatically generated during import), and text form (whether to retain rich text or plain text).

AnQiCMS's custom content model determines which fields the import table can accommodate. If the content model and the definition of custom fields do not match the structure of the target table, the extra columns in the table will not automatically become new fields, but will be silently discarded this time. Therefore, before the formal import, it is advisable to take a small sample and run a trial run to confirm that each column has fallen into the corresponding position.

Operation sequence of the Excel route

First export the standard template of the system, organize the data according to the order of the template columns, and do not create column names by yourself. When organizing, handle three aspects: unify the line breaks in long texts, unify the format of the date columns, and leave the empty value columns blank instead of filling in placeholders. After filling, save in batches, control each batch within a verifiable level, check two to three articles immediately after exporting a batch, confirm that the title, content, and classification are correct, and then proceed to the next batch.

Pay attention to the media and naming of the ZIP route.

The core of the package route is the relative relationship. Once the relative position of the picture changes within the package, the正文 referenced after import is the disconnected path. Avoid having the same name files in the same directory in terms of naming, and do not mix materials from different categories in the same directory, otherwise, an overlap will occur during merging. If there is an article list file in the package, the title field in the list must be consistent with the title in the main text, otherwise, the import result will degrade into scattered articles without ownership.

Interface route: Duplicate check by title and batch submission

The value of the interface route is controllable. Before migration, call the title search capability of /api/import/archive to determine if the manuscript already exists in the library, and update it if it exists, or create a new one if it does not. Once this rule is set, retries will not create duplicate content. The field and return structure should be in accordance with the in-site interface document, and the high-frequency API call capability covers the document list and details, categories and tags, and image upload, so the actual migration program is usually: pull the category table to establish a mapping, read the original text one by one, upload the image first and then submit the text.

Batch submission should have breakpoint records: record the titles processed in each batch, continue from the breakpoint after interruption, rather than starting over. After all submissions are completed, use the list interface to pull the quantity by category once and compare it with the source site number.

Four places to check after import.

  1. Quantity verification: whether the number of documents under the target category is consistent with the number of source content items.
  2. Media verification: whether the pictures checked can be displayed normally, and whether the path points to the internal storage.
  3. Status verification: whether the batch import results are first in draft or directly go into effect, which needs to be confirmed according to the publication plan.
  4. Inclusion verification: whether the new address has entered the site map, and whether the old address needs to be linked.

Common questions

Can the three methods be mixed?Yes, a common combination is to use tables for the main text to come in batch, and media to be supplemented piece by piece through the interface.

What should I do if the import is wrong for a round?First stop the batch, clean up the manuscripts generated in this round, and then run it again. The recycle bin can handle deletion, but you need to confirm that this batch of content has not entered the push queue.

What extra services are needed for interface import?You need to call credentials, and the interface capabilities are set according to the exposed range; this step is a separate channel from the manual background, and the scope of authority should not be mixed.

Will the import affect the original site's inclusion?Will not, the risk is at the target site: When the same content takes effect at two sites at the same time, it is necessary to decide which one to keep first.