This project provides scripts to extract URLs from a Linkwarden backup file and import them into Hoarder.
-
Node.js: If you don't have Node.js installed, you can download and install it from the official Node.js website. Choose the LTS (Long Term Support) version for your operating system.
-
Linkwarden Backup: You'll need to export your data from Linkwarden:
- Log into your Linkwarden account
- Go to Settings -> Account
- Scroll down to the "Export Data" section
- Click on "Export" to download your backup (JSON) file
-
Hoarder CLI: Install the Hoarder CLI globally using npm:
npm install -g @hoarderapp/cli
-
Hoarder API Key: You'll need an API key from Hoarder. Refer to the Hoarder documentation for instructions on how to obtain your API key.
- Clone this repository or download the
extract_urls.js
andimport_to_hoarder.sh
scripts. - Place your Linkwarden backup file (named
backup.json
by default - which extract_urls looks for) in the same directory as the scripts.
- Open a terminal.
- Navigate to the directory containing the script and your backup file (this project).
- Run the extraction script using Node.js:
node extract_urls.js
- If successful, you'll see a message indicating how many URLs were extracted, and a new file named
all_links.txt
will be created in the same directory.
-
After running the extraction script, use the import script to add the URLs to Hoarder:
bash import_to_hoarder.sh <your-hoarder-api-key> <your-hoarder-server-address>
Replace
<your-hoarder-api-key>
with your actual Hoarder API key and<your-hoarder-server-address>
with your Hoarder server address (the url you use to access hoarder). -
The script will import each URL and display a message for each imported bookmark.
If you encounter any issues:
- Make sure your Linkwarden backup file is named
backup.json
and is in the same directory as the scripts. The script is looking for a file with that exact name. - Check that you have the latest version of Node.js installed.
- Ensure that the Hoarder CLI is installed globally and accessible from your terminal.
- If you get an error about the JSON structure, your backup file might have a different format. Please open an issue with details about the error.
- If you encounter a "Permission denied" error while running the import script, you may need to make the script executable. Run the following command:
chmod +x import_to_hoarder.sh
Feel free to open issues or submit pull requests if you have suggestions for improvements or encounter any problems.