Import in bulk using both zip packages and tables. When images and fields do not match, check which side first
Compressed package and spreadsheet batch import, what should you check first when the image does not match the field? Check the spreadsheet side first. The field is the index, and the image is the reference. The reference cannot be found usually because the index was built incorrectly: column names are not aligned with custom fields, image file names and reference names in the spreadsheet are inconsistent. Make sure the side of the table is clear before looking at the compressed package, which can avoid repeatedly transmitting the same batch of files. AnQiCMS supports both ZIP compressed packages and Excel spreadsheet batch import. The data types brought in by the two channels are different, and the troubleshooting sequence is also different.
What does each import bring in?
| Import method | Carrying data | Easy to make mistakes | Check what first |
|---|---|---|---|
| ZIP compression package | Main text file, images and attachments, directory structure | File name and table reference do not match, directory hierarchy lost | Image list and naming rules |
| Excel spreadsheet | Title, category, tags, custom field values | Column names do not match field names, null values are considered valid | Table header and field对照表 |
When moving content from a historical site to a new system, it is usually to build a model first and then import data: In the custom content model, parameters such as product parameters and publishing time that need to be filtered are set as custom fields, and rich text in the body stays in the document. If the model is not set, the table is exported, and the field columns will be discarded or fall into the wrong position, and you need to run it again to make up for it once.
Check these three places when the fields do not match
The first step is to look at the table header. The column names in the first row of the table should correspond to the field names in the model column by column, and Chinese and English, spaces, and case will cause matching failure; it is recommended to delete empty columns first and only leave the columns that are really needed to be written.
The second step is to check for null values and placeholders. Historical exports often use 'No data' and '-' as placeholder text, which are treated as valid data when stored, and displayed on the front end as a bunch of placeholders. Before importing, change them to empty cells to allow the default logic of the template layer to take over.
Check for duplicates in the third step. Running the same table twice will generate duplicate documents. The AnQiCMS document content import interface (the import and archive actions in the path) supports querying whether a document already exists by title, so use it to check before running again, which will save time compared to manually deleting later. Title duplication check is more reliable than image judgment, because missing images are often just a secondary manifestation of a wrong title.
Check the side of the compressed package if the image cannot be found.
After confirming that the table side is correct, check the compressed package in this order: Are the images placed in a directory that can be located after extraction; do the filenames match the names referenced in the table exactly, including the case of the file extension; do identical files exist at multiple levels, causing uncertain reference pointers.
A common mistake is that the filenames in the table contain the directory prefix of the old site, after extraction, they are clean short filenames, and all references are empty. The method of judging this kind of problem is very direct: randomly select a few rows, compare the reference names in the table with the actual filenames in the compressed package, and if the consistency rate is below expectations, rename first, don't rush to change the system configuration.
How to check after import
Do not confirm the import result by just 'looking without any error'. Draw a few from each of the four categories: those with images, those with custom fields, those with categories and tags written, and those with duplicate titles. The status of the extracted documents should be clear - draft or formal document. AnQiCMS's document status is divided into formal documents, drafts, pending release, and recycling bin. It is recommended to import drafts first, use the preview link to check the rendering effect, and then batch convert to formal.
Leave a backup point before going online. Batch writing is a typical scenario for rollback-ability, where the backup covers data and static files. Once the fields in a batch are misaligned, it can be rolled back and rerun without manual correction for each item.
Common questions
Should we import thousands of articles at once or in batches?Batching is more stable, cutting batches by category, checking each batch after import; if a single batch has a problem, it only affects that batch, and the rollback range is small.
Both the field and the image are incorrect at the same time, which one should be repaired first?Repair the field first. A field error will cause the overall misalignment of the reference relationship, making it look like the image is also missing.
Will rerunning it produce duplicate documents?Will, so first use the query by title to determine if the import interface already exists, and then decide whether to skip or overwrite.