[GH-ISSUE #11734] Fix chat import from chatgpt json file. import & preserve unix timestamp "create_time" "update_time" #55001

Closed
opened 2026-05-05 17:00:37 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @samsong on GitHub (Mar 16, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/11734

openwebui does not import & save the chatgpt JSON export timestamp
"create_time" & "update_time"

please add this feature

manual fix possible for now below instructions how i did it

  • Export ChatGPT json.

  • Open file: regex remove the seconds from timestamp, save close

  • Upload file to: https://tableconvert.com/json-to-sql - download "insert sql" (sqlite) including table creation, tablename "chatgpt"

  • Download openwebui database: filename webui.db

  • Open it using (Windows) sqlite db browser

  • Import chat SQL file to a table called "chatgpt"

  • run this command:

UPDATE chat
SET created_at = (
    SELECT chatgpt.create_time 
    FROM chatgpt 
    WHERE chatgpt.title = chat.title
),
updated_at = (
    SELECT chatgpt.update_time 
    FROM chatgpt 
    WHERE chatgpt.title = chat.title
)
WHERE EXISTS (
    SELECT 1 FROM chatgpt WHERE chatgpt.title = chat.title
);
  • close the database, upload file replace webui.db

  • run openwebui. all chats will be date sorted.

owebui

Originally posted by @samsong in https://github.com/open-webui/open-webui/discussions/5682#discussioncomment-12513952

Originally created by @samsong on GitHub (Mar 16, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/11734 openwebui does not import & save the chatgpt JSON export timestamp "create_time" & "update_time" please add this feature manual fix possible for now below instructions how i did it - Export ChatGPT json. - Open file: regex remove the seconds from timestamp, save close - Upload file to: https://tableconvert.com/json-to-sql - download "insert sql" (sqlite) including table creation, tablename "chatgpt" - Download openwebui database: filename webui.db - Open it using (Windows) sqlite db browser - Import chat SQL file to a table called "chatgpt" - run this command: ``` UPDATE chat SET created_at = ( SELECT chatgpt.create_time FROM chatgpt WHERE chatgpt.title = chat.title ), updated_at = ( SELECT chatgpt.update_time FROM chatgpt WHERE chatgpt.title = chat.title ) WHERE EXISTS ( SELECT 1 FROM chatgpt WHERE chatgpt.title = chat.title ); ``` - close the database, upload file replace webui.db - run openwebui. all chats will be date sorted. ![owebui](https://github.com/user-attachments/assets/b704591a-54b6-439b-9ca2-f691d409fcce) _Originally posted by @samsong in https://github.com/open-webui/open-webui/discussions/5682#discussioncomment-12513952_
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#55001