jDownloads Support Forum

jDownloads for Joomla 4.x and 5.x => jDownloads 4.0 => General => Topic started by: Lorange on 02.04.2024 18:26:20

Title: Bulk import/create hundreds of categories from a .csv file
Post by: Lorange on 02.04.2024 18:26:20
Hallo!

I have hundreds of categories and subcategories that I need to create in my new project, each with a title and description. Is there a way to import and create them automatically, for example with a csv file?

I already have the csv file ready with all the categories. Each category has the following elements;

1) Category name (title)
2) Category description
3) Category Alias
4) Parent categoriy Alias (used to identifiy the parent category)

Thank you for your help.
Title: Re: Bulk import/create hundreds of categories from a .csv file
Post by: ColinM on 03.04.2024 14:11:16
Hi
Which versions of jD, Joomla and PHP are you using?  Will they be the same on the new site?

The basic way is to use the jD Check Download Area.  Being very cautious I would
I would suggest using FTP to copy over the contents of the old site jdownloads directory to the new site jdownloads file. Actually just copy over a section of the Folders and their Downloads to avoid timeouts, then use the Check Download Area - "Search Only for new directories". Next use the "Search only for new Files" Do not attempt to do all in one hit, just be patient

 Make backups first just in case!!
See Monitoring Options

Colin
Title: Re: Bulk import/create hundreds of categories from a .csv file
Post by: Lorange on 03.04.2024 17:03:53
Hi,

I'm using the latest versions of Joomla and jD, PHPO 8.2. It's actually a brand new project. I have no files to migrate. I just need a way to automatically create the categories with their respective description. I have more than 300 categories, each with its own description. It would be very time consuming to create them manually in jD. The solution you suggested (jD Check Download Area > "Search Only for new directories") would create the categories but not their descriptions.

I have a .csv file ready that look like this:

#### CATEGORY NAME ######## CATEGORY ALIAS ########### CATEGORY DESCRIPTION ########### PARENT CATEGORY ####
Example Name 1example-name-1Example description of the category 1
Example Name 2example-name-2Example description of the category 2
Example Name 3example-name-3Example description of the category 3example-name-1
Example Name 4example-name-4Example description of the category 4
Example Name 5example-name-5Example description of the category 5example-name-2
Example Name 6example-name-6Example description of the category 6
Example Name 7example-name-7Example description of the category 7
Example Name 8example-name-8Example description of the category 8example-name-1

In the example above, the category 8 would be a child of Category 1. I just need theses categories (more than 300) to be created in jD (in the database).

Is there a way to achieve that?
Title: Re: Bulk import/create hundreds of categories from a .csv file
Post by: ColinM on 04.04.2024 12:57:01
Lorange
Had not appreciated it was a totally new site.
The way to add the category info you have is to import to the data using the import facilities of your Mysql database. 
Select the Category table and then use the Input

It accepts several forms and I have added examples using CSV and Open Office formats.  Note that the first line gives the entry names in the table.  Most importantly there must be an entry for evey item, which may be blank.
There is no way of a mass entry with details like description unlee all such items are identical.

Obviously try with a simple example.

Colin