Skip to content

Conversation

@gbcox
Copy link
Contributor

@gbcox gbcox commented Dec 14, 2025

This adds a new authenticated API endpoint that allows clients to import
entries directly into an existing feed.

The endpoint is intended to support data migration from other feed readers
(for example, Tiny Tiny RSS to Miniflux migration) where entries do not
originate from standard feed parsing.

This endpoint was tested by importing an existing Tiny Tiny RSS database
into Miniflux, covering ~2.1 million entries spanning 2003–2025. The test
included preserving entry dates and avoiding duplicate entries during import.

Checklist:

  • I have tested my changes
  • There are no breaking changes
  • I have thoroughly tested my changes and verified there are no regressions
  • My commit messages follow the Conventional Commits specification
  • I have read and understood the contribution guidelines

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new authenticated REST API endpoint (POST /feeds/{feedID}/entries/import) to support importing individual entries directly into an existing feed. The endpoint is designed to facilitate data migration from other feed readers (such as Tiny Tiny RSS) where entries don't originate from standard feed parsing. The implementation includes storage layer support for inserting entries with duplicate detection based on entry hash.

  • New InsertEntryForFeed storage method that handles entry creation or update with transaction management
  • New importFeedEntry API handler with support for custom entry metadata (published dates, status, starred state, tags, external IDs)
  • Route registration for the new import endpoint

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 12 comments.

File Description
internal/storage/entry.go Adds InsertEntryForFeed method for inserting or updating a single entry with transaction handling and duplicate detection
internal/api/entry.go Adds EntryImportRequest struct and importFeedEntry handler to process entry import requests with validation and metadata handling
internal/api/api.go Registers the new /feeds/{feedID}/entries/import POST route for the import endpoint

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@fguillot fguillot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition to the issues reported by Copilot, it would be helpful to add an integration test to validate this endpoint and update the Go client accordingly.

@gbcox
Copy link
Contributor Author

gbcox commented Dec 24, 2025

Thanks for the review.

I’ll add an integration test for this endpoint and update the Go client accordingly.

I’ll also move EntryImportRequest to payload.go to match existing conventions.

Regarding updateExisting, you’re right — it’s not needed in the current design. I’ll remove that argument and simplify the storage API.

@JPFrancoia
Copy link

Hi @gbcox , like you I'm migrating from ttrss. May I suggest you also create a "Show and tell" post in the discussions, for more visibility? I'm sure there are other people that will migrate in the next few weeks. I ended up writing a dirty migration script, but I would have used your tool if I had known it existed 😅

@gbcox
Copy link
Contributor Author

gbcox commented Dec 28, 2025

Hi @JPFrancoia, Thanks, I submitted the PR mainly because I assumed others might run into the same ttrss migration issue. If it’s accepted, adding a short Discussions post would make sense. I also have a small Python script I used that could be helpful.

@fguillot fguillot merged commit 90a389a into miniflux:main Dec 29, 2025
10 checks passed
@gbcox gbcox deleted the api-entry-import branch December 29, 2025 01:04
dsh2dsh added a commit to dsh2dsh/miniflux that referenced this pull request Dec 29, 2025
Refactor miniflux#3946 for reusing existing code.

Revert not relevant miniflux#3945.

Revert miniflux#3928 because I think this project doesn't need that
functionality.
dsh2dsh added a commit to dsh2dsh/miniflux that referenced this pull request Jan 1, 2026
Reimplement miniflux#3928 my way + some refactoring.

Now the endpoint references the feed by its URL, instead of id. It imports
multiple entries instead of one entry.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants