wallabag: Pocket imports are not working at all
Environment
- Version: 2.6.9
- Installation: Docker
- PHP version: 8.1
- OS: Debian 12
- Database: SQLite / MySQL
- Parameters: Not relevant
What is the bug?
Wallabag fails to import Pocket links.
When trying to import using the Pocket API, the import fails randomly. Sometimes it imports nothing, sometimes it imports 100-200 links. After that it fails with a cryptic error message such as:
An exception occurred while executing a query: SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: ‘\xF0\x9F\x91\x87</…’ for column wallabag.wallabag_entry.content at row 1
Even though the imported links do not contain any UTF-8 codepoints or smilies.
Converting the exported file to JSON and then importing that using the Wallabagv2 JSON importer also fails for similar reasons.
What steps will reproduce the bug?
- Install Wallabag in a Docker container
- Try to import Pocket links using the API
- It fails
If you need anymore information please let me know.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 22 (7 by maintainers)
Import from Pocket into wallabag.it thanks to the HTML file will be available in coming weeks.
Seeing the same on a wallbag.it account
Web and retrieve are enabled.
I tried @utrenkner 's solution, but I was getting timeouts while trying to import the CSV, so I ended up using the API to import all data.
part_000000.csvClient IDand theClient Secretfor the next stepconvert.py) and modify the variables on the top with your dataProfit!
That is excellent news! I just subscribed as a supporter for your service. Even though I might end up hosting Wallabag myself, I am happy that you offer this service and support this eco-system! Many thanks.
I have investigated this and found it to be an error from requesting too many entries from pocket. Their API documentation specifies a maximum of 30 entries per query (see the Pagination section of this page).
Changing NB_ELEMENTS in
PocketImport.phpto 30 seems to fix the issue, at least for me.Excellent news! Does this include support of the date field included in the CSV file during import?
We are working on the Pocket import via their export file
As this imho still doesn’t work and many people will need it with Pocket closing, I put together script from @cgkantidis (thanks!) and added support for tags and archive status. Maybe it will help someone: https://codeberg.org/kepi/wallaback_pocket_csv_import
I don’t know if the patch does not work or if it has not yet found its way into wallabag.it. I still get the error-message when I try to import my 2500+ URLs from Pocket.
For those who, like me, do not want to wait any longer: You can export your Pocket data via https://getpocket.com/export. They will e-mail you a zip file with a CSV of your saved pages, which is structured like this:
This is very similar to the Instapaper export file, which looks like this:
I rearranged the columns in my favorite spreadsheet application, saved it as CSV, and was able to use the Instapaper import of Wallabag.
Note, that the column “Folder” in the Instapaper CSV is translated to tags in Wallabag. However, it seems that the content of the Folder field is taken as one tag. So if the Pocket export file contains several tags for one page, it is saved as “tag1|tag2|tag3”. And exactly this string is interpreted by the Wallabag-Instaper importer as one tag. I went through all entries that had more than one tag in Pocket (i.e. at least one pipe in the tags column) and deleted all but one of them. Worked fine for me.
@Ribero obviously 😊 https://github.com/wallabag/wallabag/pull/8186/files#diff-12b536334511fcf69e7e820bed97807eb494719c9d0c23982efb6714cdcdcb87R124
Thank you @ruffinge and @j0k3r!!!
@nicosomb Could you please let us know, once wallabag.it has updated to a version which includes this commit?
Same problem here. Trying to import my Pocket collection into wallabag.it.
Is there an import for TXT or CSV with just URLs? I used Pocket’s export to have all my saved articles’ URLs in a CSV file, but I don’t see an option to import a list into Wallabag.
@j0k3r true. Then just the second line is relevant.