Skip to Content Skip to Menu

Import Data files into Joomla and link to User Profile page

  • robintr3
  • robintr3
  • ONLINE
  • Posts: 21
  • Thanks: 3
  • Karma: 0
2 years 11 months ago #327409 by robintr3
Hello,

I have a current website that will soon be losing the development environment support, so I'm rewriting the website in Joomla. The current site uses a PostgreSQL Database. I've export the tables I needed from PostgreSQL into .cvs format. I managed to import about 6000 users into my new Joomla development site.

The 1st question is, I did not use the password field when importing, as the Joomlapolis Forums stated a new password would be autogenerated. This was not the case. I have 6000 users with a blank password field. Is there a way to autogenerate passwords for the 6000 users?

The 2nd question is more complex: My current website has users who have uploaded content to their individual profile pages (*.mp3, *.jpg, *.doc, etc). Is there a way to import these files into my new Joomla site and have them linked to the correct user? The data files are currently in a file store folder on my local workstation (C:\shared\system). Would it be better to revert and import users and their corresponding data directly into the Joomla database via sql backed? I have limited SQL experience. I can revert the Joomla database to a pristine state if need be.

I'm working with CommunityBuilder 2.6.4 in Joomla 3.10.3

Thank you all.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
2 years 11 months ago #327428 by krileon

The 1st question is, I did not use the password field when importing, as the Joomlapolis Forums stated a new password would be autogenerated. This was not the case. I have 6000 users with a blank password field. Is there a way to autogenerate passwords for the 6000 users?

Did you import them with a blank password? You need to exclude password entirely from the import otherwise it'll respect whatever value you import. There is no functionality for mass generating passwords. I don't have a solution for this unfortunately. Are you sure the password is missing? It will always show as an empty input while editing, but it should exist in the _users database.

The 2nd question is more complex: My current website has users who have uploaded content to their individual profile pages (*.mp3, *.jpg, *.doc, etc). Is there a way to import these files into my new Joomla site and have them linked to the correct user? The data files are currently in a file store folder on my local workstation (C:\shared\system). Would it be better to revert and import users and their corresponding data directly into the Joomla database via sql backed? I have limited SQL experience. I can revert the Joomla database to a pristine state if need be.

Are those files a part of a gallery or an individual field? CB Gallery and file fieldtypes for example have entirely different file and database structures so how you plan to use the files will be important. Both are doable in regards to migrating them over, but you'll need to do the work of writing the SQL inserts to migrate from 1 database structure to another.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • robintr3
  • robintr3
  • ONLINE
  • Posts: 21
  • Thanks: 3
  • Karma: 0
2 years 11 months ago #327430 by robintr3
Hi Kyle,

The "users" table that was extracted from PostgreSql included a "crypted_password" column. I assumed PostgreSQL and MySQL do not use the same encryption technology, so I excluded the password column when creating the file to be imported to my Joomla site.

As far as the datafiles go, I would like the to include them as part of the Users CB Gallery profile. The site is designed for musicians, to post their songs, along with any photos they want to attach and a description of each piece. Under the C:\shared\system folder are folders associated with the users that contain the data, eg file_uploads, images, photos, thumbnails etc.

Thanks for you great support

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
2 years 11 months ago #327436 by krileon

The "users" table that was extracted from PostgreSql included a "crypted_password" column. I assumed PostgreSQL and MySQL do not use the same encryption technology, so I excluded the password column when creating the file to be imported to my Joomla site.

How did you import your users? If using CB > User Management to import you should export and existing user to get the structure, remove password column since you don't need it, and place your data in that structure. This will create the users using normal backend user create process, which will generate passwords for them. If you imported directly using the database that'd be why they're missing passwords.

As far as the datafiles go, I would like the to include them as part of the Users CB Gallery profile. The site is designed for musicians, to post their songs, along with any photos they want to attach and a description of each piece. Under the C:\shared\system folder are folders associated with the users that contain the data, eg file_uploads, images, photos, thumbnails etc.

Ok, then the file structure for CB Gallery is as follows.

/images/comprofiler/plug_cbgallery/USER_ID/MEDIA_TYPE/FILE

So for example if you have a "test.png", which is a photo, and it belongs to user 406 you'd have the below.

/images/comprofiler/plug_cbgallery/406/photos/test.png

MEDIA_TYPE can be "files", "photos", "music", and "videos". Note for photos it expects a thumbnail, but can handle situations where one is missing. In the above example the thumbnail would be in that same folder, but prefixed with "tn" so it'd be "tntest.png".

As for the database the media is stored in _comprofiler_plugin_gallery_items. Upload a photo to your profile and review its structure there. Below is a little description.

Asset = where the photo belongs. For profile galleries this is just "profile.USER_ID".
Type = same as MEDIA_TYPE above
Value = the filename of the file as stored on your site in the above folder structure
File = the original filename and is used for display purposes only
Folder = the album the media belongs to.. leave as 0 for no album if none exist for the user
Title = whatever the user decided to title the media
Description = whatever the user decided to describe the media
Thumbnail = can just ignore this as it holds the thumbnail image filename for music/videos if supplied
Published = published status of the media (-1 pending approval, 0 unpublished, 1 published)
Date = date media was created


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • robintr3
  • robintr3
  • ONLINE
  • Posts: 21
  • Thanks: 3
  • Karma: 0
2 years 11 months ago #327448 by robintr3
I did export the users table from Joomla to get the column names. I will revert to a previous database and ensure I have the correct columns defined. I did import the cvs file using CB User manager, but it would timeout after about 30 seconds, so had to use smaller cvs files. I read there was a way of increasing the timeout value in the .htdocs file - but that didn't work for me.

Thank you for the description for importing the data files. I will certainly test your suggestion when I get back to my development environment this evening.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
2 years 11 months ago #327464 by krileon
Do an export from CB > User Management to get the CSV structure. It'll have all your fields already in it. Password is automatically excluded. If you do a raw export from the database you must delete the password column from your CSV file before importing.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum