Write migration script for Leech 1.9 to FeedAPI 1.0.

Members fund testing for the Drupal project. Drupal Association Learn more


ahneill’s picture

I agree a migration script is needed... for those who have used leech to aggregate but want to take advantage of the long term flexibility of feedapi...


I can commit $50 if we see some results.



alex_b’s picture

I can't do anything until in a week or two.

If somebody wants to step up here, I will be happy to give advice (free of charge :).

brashquido’s picture

Seeing as Leech is to be no more in D6, I'd love to see an upgrade script too.

Aron Novak’s picture

Title: Migration script Leech->FeedAPI » Migration script Leech->FeedAPI, ready!
4.44 KB

This is the migration script. You can use it, but only for your own risk. A complicated site may be loss data. Read the instructions very carefully, you can read it in the file comment header.

MMachnik’s picture

4.9 KB

I needed to convert from Leech to FeedAPI 1.1. I had to make some modifications to the script so it would work. Here it is in case it helps anyone. Same disclaimer as Aron's.

Important differences between this version and the 1.0 version:

* there were database changes, so this script reflects those. The 1.0 script on this page will fail if used with the 1.1 module.
* changed node migration to use the node's created time as the feedapi item's timestamp, preserving the times stored before. The 1.0 version of the script just sets it to the current time.
* added some output to tell you more about what it is doing.
* fixed call to feedapi_get_settings() which used to be _feedapi_get_settings() in FeedAPI 1.0.

I cleaned this up a little before posting it here, so hopefully I did not miss anything. I definitely suggest you run this only on a development site until you are sure it does what you want, and also that you back up your database first.

Thank you to Aron for providing the initial version of this script, I could not have done the migration to FeedAPI without it!

alex_b’s picture

MMachnik, thank you very much for providing the 1.1 script.

jgraham’s picture

Just an FYI for anybody migrating a multi-site setup I needed to do this to just one site in a multi-site setup. Also I'm sure there is a cleaner way to do this, but this worked in my situation.

The code snippet at the bottom replaces the following section in the original file;



Replacement snippet, please note to replace YOURSITE with the appropriate site and YOURSITE_DB_URL with the appropriate $db_url. I'm sure some of this can be cleaned up.


// all bootstrapping except later stage
// bootstrap db 
require_once './includes/database.inc';
global $db_url;

Please also note that this is not functionally equivalent and may run into troubles as the later bootstrapping stages (after db) are skipped.

Aron Novak’s picture

Status: Active » Fixed

I saw a successful migration from Leech to FeedAPI a few days ago, so i think if somebody wants to migrate, it's possible :)

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

Aron Novak’s picture

Status: Closed (fixed) » Fixed

The 1.1 migration script is not perfect. The feed_item cross table remains empty.
Here is an SQL statement what is missing:

INSERT INTO feedapi_node_item_feed (feed_nid, feed_item_nid) (SELECT fid, nid from leech_news_item);

So just simply execute the migration script and after that, run the above query. If you have table prefixes, of course, add the prefix to the query as well.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

ScriptLeech’s picture

Component: Code » Code feedapi (core module)

Thank you very much!

Respect, ScriptLeech.com