Create a free account to get access to additional free training videos. Enjoy this free video from CraftQuest! Create a free account to get access to additional free training videos. Join the Community

Migrating a Website to Craft CMS

Importing Data into Craft

Before we export any data, we need to decide on our import strategy and tool. In Craft we can use the Feed Me plugin to easily import and map our content to existing fields.

Con­tin­u­ing our work on migrat­ing a web­site to Craft CMS, let’s dis­cuss choos­ing our import tool. Before export­ing data, we need to have our import tool in place. This is cru­cial because we need to know the struc­ture and for­mat of the data required for import.

Why choose the import tool first?

  1. It’s eas­i­er to adjust your export data to fit the import tool than vice versa.
  2. You need to know the tool’s lim­i­ta­tions and sup­port­ed for­mats (JSON, XML, CSV, etc.).

For Craft CMS, the best off-the-shelf option is Feed Me, a free plu­g­in from Craft CMS. It allows you to import mul­ti­ple entry types like entries, cat­e­gories, and users.

Let’s look at how to set up Feed Me:

  1. Install Feed Me from the Craft Plu­g­in Store.
  2. Cre­ate a new feed (e.g., blog import”).
  3. Choose the data type (JSON rec­om­mend­ed) and ele­ment type (e.g., entry).
  4. Select the sec­tion and entry type.
  5. Map Craft fields to the import­ed data elements.
  6. Set a unique iden­ti­fi­er to avoid duplicates.
  7. Run the import process.

Tips for cre­at­ing a con­tent import plan:

  1. Start sim­ple and improve the import as you go.
  2. Import relat­ed con­tent first, then the main data.
  3. Sub­se­quent imports should update exist­ing data, not add duplicates.
  4. Be patient and learn from each import attempt.
  5. Aim for a reusable import mech­a­nism that you can run mul­ti­ple times with­out data destruction.

Addi­tion­al considerations:

  1. Add a lega­cy ID field to main­tain con­nec­tions between old and new data.
  2. This helps with match­ing import­ed data and ver­i­fy­ing the import process.

Next, we’ll dis­cuss export­ing data into an importable for­mat, keep­ing in mind that we’ll be using Feed Me and aim­ing for JSON for­mat if possible.

Migrating a Website to Craft CMS is made up of the following videos: