Hello.

I am trying to import data from a Backdrop site to another Backdrop site.

I've created an importer for vocabularies/taxonomies/terms with the Feeds module.

In the Taxonomy term processor Mapping , I have added

  • GUID
  • Term name
  • Parent:Term name (parent)
  • Path alias (path_alias)

When I actually imported them using the importer with a CSV file, the items I entered in the Path alias (e.g. tags/information, tags/information/event, etc.) were not imported at all.
How do I write the Path alias?

Thanks;

Comments

Olafski's picture

I don't know how to import a Path alias but here's an idea for another approach:

  • Check the URL alias pattern for the vocabularies in question on the page URL Alias Patterns (admin/config/urls/path/patterns):
    • Depending on your needs, choose a  custom pattern, e.g. [colors]/[term:name], or leave the default  pattern [term:vocabulary]/[term:name].
  • Import your vocabularies without path aliases.
  • Go to the page URL Aliases Bulk Actions (admin/config/urls/path/bulk-update).
    • Scroll down to section Taxonomy term URL aliases, and select the imported vocabularies.
    • Scroll back to the top of the page, section Operations. Choose the action Generate URL aliases, and hit the Execute button.

      If this action doesn't work, you may also want to try the action Update existing URL aliases.

  • Go to your vocabulary page, e.g. admin/structure/taxonomy/tags, and check the terms for their aliases.

Let me know if the approach works for you.

Olafski's picture

Well, I was curious and tried to import some terms into a test site, and that worked quite well, even without the bulk action to generate URL aliases. I followed these steps:

  • Create an empty vocabulary, example: Favorite Colors
  • Configure a URL alias pattern for the vocabulary, e.g. color/[term:name]
  • Create a Feeds importer (File upload, CSV parser), mapping:
    • GUID => GUID
    • Term => Term name
    • Alias => Path alias
  • Create a CSV file. Example:
GUID,Term,Alias
0001,Blue,colors/blue
0002,Brown,colors/brown
0003,Green,colors/green
0004,Orange,colors/orange
0005,Purple,colors/purple
0006,Red,colors/red
0007,Yellow,colors/yellow
  • Import the CSV file.
  • Check the path of the imported terms, e.g. colors/orange

I think, it would even work without importing the aliases and also without bulk generating them.