Import/redirect a list of URLs

53 views
Skip to first unread message

Christopher Calle

unread,
Mar 30, 2023, 1:33:45 PM3/30/23
to dotCMS User Group
I'm new to dotCMS and wanting to import/redirect a list of URLs from a csv file, but can't find any documentation or tutorials that makes sense. 

I have tried Search > Import Content but didn't have any success. Any help is much appreciated. 
Screenshot 2023-03-30 at 11.45.27 AM.png
Screenshot 2023-03-30 at 11.42.48 AM.png
Screenshot 2023-03-30 at 11.46.34 AM.png

Mark Pitely

unread,
Mar 30, 2023, 1:54:18 PM3/30/23
to dot...@googlegroups.com
The tops of the CSV (headings) must match exactly the content names. I'd suggest just editing the CSV.
In this instance, you called it 'Uri' in the content and 'URL' in the sheet, and 'Forward To' in the content but 'Redirect To' in the CSV.
There will likely be a hitch, either way, with your field name of 'Forward To'; I'd suggest changing it to ForwardAddress or something like that which does not have a space.
That is, the 'exactness' might be difficult with case sensitivity and non-alpha characters - it can be fidgety. It sometimes converts those fields internally to camel case - ( i.e. forward To might become forwardTo) In looking at the content type, it usually clarifies with label and varName. 
Hope that makes sense. You are close!

Mark Pitely
Albright College

On Thu, Mar 30, 2023 at 1:33 PM Christopher Calle <chris...@strategyco.com> wrote:
I'm new to dotCMS and wanting to import/redirect a list of URLs from a csv file, but can't find any documentation or tutorials that makes sense. 

I have tried Search > Import Content but didn't have any success. Any help is much appreciated. 

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/b115139c-2bfe-4eab-baab-afa45ab9b46cn%40googlegroups.com.

Mark Pitely

unread,
Mar 30, 2023, 1:55:44 PM3/30/23
to dot...@googlegroups.com
Actually, if there is any doubt, you can use the 'Click Here to see a Sample CSV' from your third thumbnail, and it will give you the exact headers you need. 

M

Christopher Calle

unread,
Mar 30, 2023, 3:09:29 PM3/30/23
to dotCMS User Group
Thank you for that Mark. 

I think I implemented what was suggested, but still found the following.



Screenshot 2023-03-30 at 2.06.29 PM.png
Screenshot 2023-03-30 at 2.07.17 PM.png
Screenshot 2023-03-30 at 2.05.09 PM.png

Scott Wicken

unread,
Mar 30, 2023, 3:10:40 PM3/30/23
to dot...@googlegroups.com
Please ensure the file is in UTF8 format, that looks like a character set issue.

To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/4b3645cb-d8ea-42bb-a896-cfb13a02cea7n%40googlegroups.com.
<Screenshot 2023-03-30 at 2.06.29 PM.png><Screenshot 2023-03-30 at 2.07.17 PM.png><Screenshot 2023-03-30 at 2.05.09 PM.png>

Mark Pitely

unread,
Mar 30, 2023, 3:16:15 PM3/30/23
to dot...@googlegroups.com
I also don't recognize what you are using to display the CSV - make sure that it saves a clean text CSV format. You should be able to open it in a Wordpad/Textpad/Sublime/Nano or whatever and make sure it is readable and has no extra fields. 
M

Christopher Calle

unread,
Mar 30, 2023, 3:39:33 PM3/30/23
to dotCMS User Group
I have tried several times more, but still unable to find success. When I add the additional fields, I receive an error. When I remove the additional fields, I still receive an error. I did make sure it was formatted to UTF8 like you mentioned and exported it as csv. What am I missing Mark?
Screenshot 2023-03-30 at 2.31.08 PM.png
Screenshot 2023-03-30 at 2.35.17 PM.png

Mark Pitely

unread,
Mar 30, 2023, 4:27:51 PM3/30/23
to dot...@googlegroups.com
I think you made 'title', 'site', and 'action' required
You have come a long way! It is reading, parsing and then not adding them because one (or all) of those fields are blank and yet required.
Either put data in all those fields or remove the 'required' quality on the Content Type for those fields. 
It's trying to do exactly what it is supposed to, and ignore new entries that don't have all the necessary information. 

M

Christopher Calle

unread,
Mar 30, 2023, 5:43:05 PM3/30/23
to dot...@googlegroups.com
I'm VERY close. 

I have a screenshot of what I'm working with. Are you referring to the Key Fields section of the form as 'required'?

Again, I sincerely appreciate the help. 

You received this message because you are subscribed to a topic in the Google Groups "dotCMS User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dotcms/UgKNiEZBltg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dotcms+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/CAFeiKqPWcyrfZfje8tZb%2BPKGJmPjBW9FxS1LQyKLLS1ATzY7-A%40mail.gmail.com.
Screenshot 2023-03-30 at 4.38.45 PM.png
Screenshot 2023-03-30 at 4.39.31 PM.png

Christopher Calle

unread,
Mar 30, 2023, 5:50:43 PM3/30/23
to dot...@googlegroups.com
And my form-in-progress of course. 
Screenshot 2023-03-30 at 4.38.37 PM.png

Mark Pitely

unread,
Mar 31, 2023, 9:22:43 AM3/31/23
to dot...@googlegroups.com
You can see that whatever you did, only 'action' is holding you up now.
That's the Virtual Links structure, which is a system structure, and you probably can't affect it - I thought this was custom content, which you could change the field requirement. 
You just need to put 301 into action and drag it down (in your CSV) - they all should have 301s, probably. (Using the HTML Redirect specification).
M

Christopher Calle

unread,
Mar 31, 2023, 3:20:14 PM3/31/23
to dot...@googlegroups.com
I was finally able to successfully import the list! 

Unfortunately, I did make a bonehead mistake and accidentally imported the URLs in the wrong columns. Now I have to figure out how to  delete the content so I can re-import correctly. Thank you so much for all the help. 

Mark Pitely

unread,
Apr 3, 2023, 9:07:50 AM4/3/23
to dot...@googlegroups.com
If you used key fields other than the URL, you can just reimport and it should overwrite.
There's a way to drop all the entries, but that's probably not an option if you have several already. 
M

Reply all
Reply to author
Forward
0 new messages