Hello,

I've tried to use the script in order to import my spip database to drupal but an error occurred while processing the importation via the module.
Here is below the message

Importing SPIP database

The batch process has failed for some reason. Please report the bug. You can restart the process by cleaning the database by using the sql sequence in file clean_db_for_testing.sql from the module base folder, and then launch the migration again.
Please continue to the error page
An error occurred. /drupal/?q=batch&id=3&op=do
Fatal error: Call to undefined function verif_plugin() in /var/www/slabory/ecrire/inc/utils.php on line 127

Could anyone help me ?

Comments

jonhattan’s picture

Please report your spip version in order to try to reproduce the error.

jonhattan’s picture

StatusFileSize
new1.15 KB

I've re-tested the module and it works for 1.926 version (note this is the code version that can be obtained from the database with this sql sencence:

SELECT * FROM spip_meta WHERE nom='version_installee'

Procedure to test & help debugging

A bit of background

Because spip stores the articles in the database with custom tags to place documents, it is needed to parse the articles the spip way in order to convert them to html before importing to drupal. This is done by calling a spip function called propre().

To use propre(), a bit of dirty hacking must be done in order to have a spip environment in which propre() can be run. That spip environment is bootstrapped in different ways across the different spip versions.

testing & debugging

Attached is a php script I used to test the bootstrap process. What the script does is:
1. connecting to the spip database
2. get the code version
3. do the bootstrap
4. get an article from the database
5. render the article with propre()

In order to use the script, you must set some settings in the first 6 lines, upload it in any place of your web root and call it from the browser. If you have command line access to the hosting, you can call it with php cli.

You should get the same bug from the script. Please report your spip code version as shown by this script, or as shown by the module when the settings at admin/settings/spip2drupal are stored.

If you have coding skills, I invite you to get crazy trying to do the proper spip bootstrap :)

dorian670’s picture

Hi,

Thank you very much for your help, I haven't got time so far to follow your instruction but im gonna try it. I'll keep you posted about the result.

I've got this version
version_installee 1.927 non 2007-12-27 22:15:56

Thanks once again for your time !

Jimmy

dorian670’s picture

I downloaded your script but I've got an error while using tar ......
tar: This does not look like a tar archive
tar: Skipping to next header
tar: Error exit delayed from previous errors

jonhattan’s picture

It's not a tar file buz a gzipped one.

gunzip propre.php_.gz 
mv propre.php_ propre.php
elektrorl’s picture

it does not work:

propre.php gives:

SPIP VERSION: 1.927 
Warning: chdir() [function.chdir]: No such file or directory (errno 2) in /homepages/17/d248874041/htdocs/propre.php on line 26

Warning: require_once(ecrire/inc_version.php) [function.require-once]: failed to open stream: No such file or directory in /homepages/17/d248874041/htdocs/propre.php on line 49

Fatal error: require_once() [function.require]: Failed opening required 'ecrire/inc_version.php' (include_path='.:/usr/lib/php5:/bagnolet_spip') in /homepages/17/d248874041/htdocs/propre.php on line 49

and migrate spip to drupal module gives:

Une erreur s'est produite. /batch?id=6&op=do <br /> <b>Fatal error</b>: Call to undefined function verif_plugin() in <b>/homepages/17/d248874041/htdocs/bagnolet_spip/ecrire/inc/utils.php</b> on line <b>127</b><br />

I think it's the SPIP path. But in the module setting, it says it's right, all green!

Please help, I hate SPIP ! I want to move the site to Drupal!!!!!

jonhattan’s picture

If you are using a shared server, probably the option safe_mode is enabled in php. As stated in http://php.net/chdir :

Note: When safe mode is enabled, PHP checks whether the directory in which the script is operating has the same UID (owner) as the script that is being executed..

There are also some other options related to safe_mode, see http://php.net/safe_mode

You can see if safe_mode is enabled with phpinfo().

I've put the same version of propre.php with extra check conditions at:

http://faita.net/~jonhattan/propre.php.txt

mediacteurs’s picture

Hello,

I had the same error Call to undefined function verif_plugin() that you can solve by adding in spip2drupal.module, the line

require_once('ecrire/inc/plugin.php');

after the line 666 in the _spip_bootstrap() function

Thanks for this usefull module.

dorian670’s picture

Hi,

I have changed the propre.php with the new propre.php above from Jonathan, I have added the require_once('ecrire/inc/plugin.php'); in the line 666 in the _spip_bootstrap() function and I have checked that the safe_mode is well Off as you can see
safe_mode Off Off
safe_mode_exec_dir no value no value

but it still doesn't work.

Here is the output error

*** FROM DRUPAL ***
Importing SPIP database

The batch process has failed for some reason. Please report the bug. You can restart the process by cleaning the database by using the sql sequence in file clean_db_for_testing.sql from the module base folder, and then launch the migration again.
Please continue to the error page
An error occurred. /drupal/?q=batch&id=30&op=do

*** FROM PROPRE.PHP ***
The SPIP_PATH is wrong or you don't have read access to it (perhaps because of safe_mode on).

*******

The SPIP_PATH is good I guess and I have got the 777 rights on the folder.
define('SPIP_PATH', '/var/www/spip');

the propre.php file is located in /var/www/spip

I don't know where the problem is......

Any idea ???? Would be great to find the right solution to migrate spip to drupal......

Thanks for any suggestions ....

Dorian

rfabbri’s picture

StatusFileSize
new5.42 KB

I've found the solution !

There are several includes missing to add in the spip2drupal.module file :

Line 666 add theses lines after the include statements for 1.9.15 -> 2.x versions :

require_once('ecrire/inc/texte.php');
require_once('ecrire/inc/revisions.php');

The corrected module file is attached.

Hope this helps...

plsk’s picture

StatusFileSize
new4.1 KB

Je ne comprend pas "SPIP DocumentRoot :" il faut donner quoi comme indication ?

par avance merci

I do not understand "SPIP DocumentRoot:" What should be given as an indication?

by advance

Thank you

jonhattan’s picture

Status: Active » Closed (fixed)

plsk: please next time open a new issue, to avoid going off-topic.

On-Topic:

Thanks to mediacteurs, rfabbri and other for testing and debugging. I have been able to reproduce the safe_mode On thing but I've hadn't the problems you report perhaps because I've not a spip site with plugins enabled. I added the three new required includes and tested it with no failure so I've done commit. A new release will be available in the next hours with some other cosmetic changes. See details in the CHANGELOG.

dorian670’s picture

The SPIP document root is just the path where the spip site is hosted, for instance in my personnel server that would be in /var/www/spip or /home/dorian/www/spip

Let me know if you have been able to migrate you spip to drupal......

Thanks ;;

dorian670’s picture

Hi,

Thanks rfabbri for your help, so I have tried to add the two lines in the spip module as written above but that time I have got this output error from drupal
***
The batch process has failed for some reason. Please report the bug. You can restart the process by cleaning the database by using the sql sequence in file clean_db_for_testing.sql from the module base folder, and then launch the migration again.
Please continue to the error page
***

Im gonna go crazy, the solution may be not too far.

The migration seems to be fine up to this point

*** logs from the migration ***

* term id: 334 attached to parent: 333
* term id: 336 attached to parent: 297
* An error occurred while processing _import_articles with arguments :_import_articles

* user warning: Duplicate entry '25' for key 1 query: INSERT INTO spip_rubriques (id_rubrique, tid) VALUES (25,0) in /var/www/drupal/modules/spip2drupal/spip2drupal.module on line 488.
* user warning: Duplicate entry '7' for key 1 query: INSERT INTO spip_rubriques (id_rubrique, tid) VALUES (7,0) in /var/www/drupal/modules/spip2drupal/spip2drupal.module on line 488.

so on ....

****

The clean_db_for_testing.sql file has been run and I have checked out that there are not duplicate rows in the database but still the same error....

Any light ????

Cheers !

Dorian

dorian670’s picture

Category: bug » support
Status: Closed (fixed) » Active

Hi,

Thanks rfabbri for your help, so I have tried to add the two lines in the spip module as written above but that time I have got this output error from drupal
***
The batch process has failed for some reason. Please report the bug. You can restart the process by cleaning the database by using the sql sequence in file clean_db_for_testing.sql from the module base folder, and then launch the migration again.
Please continue to the error page
***

Im gonna go crazy, the solution may be not too far.

The migration seems to be fine up to this point

*** logs from the migration ***

* term id: 334 attached to parent: 333
* term id: 336 attached to parent: 297
* An error occurred while processing _import_articles with arguments :_import_articles

* user warning: Duplicate entry '25' for key 1 query: INSERT INTO spip_rubriques (id_rubrique, tid) VALUES (25,0) in /var/www/drupal/modules/spip2drupal/spip2drupal.module on line 488.
* user warning: Duplicate entry '7' for key 1 query: INSERT INTO spip_rubriques (id_rubrique, tid) VALUES (7,0) in /var/www/drupal/modules/spip2drupal/spip2drupal.module on line 488.

so on ....

****

The clean_db_for_testing.sql file has been run and I have checked out that there are not duplicate rows in the database but still the same error....

Any light ????

Cheers !

Dorian

Countzero’s picture

Thanks for begining this project. I'm trying to understand the thing as I have to migrate a site.

I stumble on an error when running propre.php corrected as mentionned earlier in this thread which is not mentionned here as of now :

array_flip() [function.array-flip]: The argument should be an array dans
/web/ecrire/inc/charsets.php à la ligne 319.

The array $GLOBALS['CHARSET'][$charset] is null, as is $charset, but $GLOBALS['CHARSET'] contains :

array(1) {
["iso-8859-1"]=>
array(0) {
}
}

I guess it has something to do with UTF-8 - which is perfectly functional on my server.

Additionaly, the follonwing error pops out afterwards :

Fatal error: Cannot redeclare public_assembler_dist() (previously declared in
/web8/web/ecrire/public/assembler.php:19) in
/web/plugins/balise_session/public/assembler.php on line 61

It's probably caused by a plugin I installed a long time ago. I'll be able to disable it during the migration process, so the first error is the one to concentrate on IMHO.

I'll follow this page closely for any information and try to help as much as I can with this module.

Cheers

EDIT : As of this thread, I managed to suppress the error about the charset : http://forum.spip.org/fr_200369.html

The second one remains, though.

Countzero’s picture

Title: migrate spip to drupal » Suite

I managed to bypass the plugin on my SPIP install.

Now I have a new error :

Une erreur s'est produite. /drupal/batch?id=1&op=do

... and in the log : Invalid argument supplied for foreach() dans /srv/sites/web8/web/drupal/includes/batch.inc à la ligne 294.

It is a call to the $batch array.

I changed the value of $STEP and some output in the module code to debug. I tried to undo these changes and now the import hangs on the first article, which happens to have an accentuated character in the title.

The last watchdog message is produced by this call : watchdog("s2d-texte", $article['texte']);. It's truncated before the first accentuated character.

I'm stuck.

Countzero’s picture

OK, I converted SPIP charset from 8859-1 to UTF-8 and the message is no longer truncated.

Unfortunately, it doesn't import any article, and taxonomy terms are created with garbage in place of the accentuated characters.

stijn vanhandsaeme’s picture

hi there,
same issue here as #15 with drupal 6.11 and spip 1.9.2 [8782]. as i get no error message that makes sense it is difficult to proceed.

The batch process has failed for some reason. Please report the bug. You can restart the process by cleaning the database by using the sql sequence in file clean_db_for_testing.sql from the module base folder, and then launch the migration again.
Ga verder naar de fout pagina
Een fout is opgetreden. /drupal/batch?id=1&op=do 
stijn vanhandsaeme’s picture

Title: Suite » spip-listes

ok i got it working by disabling spip-listes plugin. thanks!

stijn vanhandsaeme’s picture

Title: spip-listes » errors

i'm sorry but i can't recreate the solution. als onot by disabling all plugins. to me it seems it has to do with the character sets because it stops in the middle of the first article.

stijn vanhandsaeme’s picture

alright, i got it working by adding these two lines i think:

require_once('ecrire/inc/plugin.php');
require_once('ecrire/inc/meta.php');

but i believe the problem was really that spip allows
- different users with the same author name (not sure if this one is a problem here)
- users without an e-mail address (we had about 500 authors of which 100 did have an e-mailaddress: i had dive into the database to get more than 500 nodes published, manually altering their uid to another existing user or anonymous)

hope this helps other people prepare their migration and improving this module (i have another site i want to migrate that is even bigger)

dorian670’s picture

Hi,

I got it working as well by adding require_once('ecrire/inc/meta.php'); in the spip module and by disabling all plugins in spip.

Thanks very much yichalal !

Dorian

bionet’s picture

Hello,

I'm a french user of SPIP and I want to migrate my website
(www.biotechno.fr) to drupal (www.biotechno.fr/drupal).

I'm in way to use the module named spip2drupal but I don't understand one
thing : Into "spipSettings" I don't know exactly what I have to write in
"SPIP DocumentRoot". I think it's "/www" because my SPIP is in the root of
the server but it's not functionnal.

The error is : "Fatal error: require_once() [function.require]: Failed
opening required 'ecrire/inc_version.php'
(include_path='.:/usr/local/lib/php:/www') in
/homez.16/biotechn/www/drupal/modules/spip2drupal/spip2drupal.module on line
588"

SPIP is in the root : /www (-> http://www.biotechno.fr)
Drupal is in the repository : /www/drupal in the same host. (->
http://www.biotechno.fr/drupal)

If I test "/homez.16/biotechn/www" it doesn't work too.

If you have an answer I will be very happy,

SPIP 2.0.8 and Drupal 6.12

dorian670’s picture

Hi,
What's the folder's name of the biotech site ? /homez.16/biotechn/www/biotech.fr ??

MarcAtQuod’s picture

Hello,

I have the same problems as many people ;-(

Spip 1.92h without any plugins, 800+ articles,
propre.php running well : SPIP VERSION: 1.927 and an article nicely displayed.
Drupal 6.13, on the same server

But same problem like others :

The batch process has failed for some reason. Please report the bug. You can restart the process by cleaning the database by using the sql sequence in file clean_db_for_testing.sql from the module base folder, and then launch the migration again.
Merci de continuer sur la page d'erreur
Une erreur HTTP 500 s'est produite. /drupal/batch?id=1&op=do

And :

....
# new term id: 246
# new term id: 247
# new term id: 248
# new term id: 249
# term id: 1 attached to parent: 230
# term id: 2 attached to parent: 1
...
# term id: 247 attached to parent: 51
# term id: 248 attached to parent: 247
# term id: 249 attached to parent: 64
# An error occurred while processing _import_articles with arguments :_import_articles

In the DB :

spip_articles 0 MyISAM utf8_general_ci 1,0 Kio -
spip_auteurs 0 MyISAM utf8_general_ci 1,0 Kio -
spip_breves 0 MyISAM utf8_general_ci 1,0 Kio -
spip_mots 0 MyISAM utf8_general_ci 1,0 Kio -
spip_rubriques 249 MyISAM utf8_general_ci 7,2 Kio -
spip_sites 0 MyISAM utf8_general_ci 1,0 Kio -

and the datas - spip_rubriques :

...
1 0
2 0
3 0
4 0
5 0
6 0
...

So : nothing running well....

jonhattan’s picture

try disabling plugins.

MarcAtQuod’s picture

As I wrote : no plugins !

I found a problem into "propre" trying to loading inc/math : I removed this and it is ok now.

Question: what happens to the document attached to the articles? I see none of them

Thanks,
Marc

MarcAtQuod’s picture

StatusFileSize
new977 bytes

Hello,

We created a "quick & dirty" script (thanks to Mickaël, a colleague of mine) to set the documents into the newly created nodes in drupal.

Please, use it carefully and without any garantie !

You need to change the path of your drupal site in order to run this script through phpmyadmin for example...

jonhattan’s picture

Status: Active » Fixed

The module no longer uses the SPIP api. I'm working on a custom function to parse spip tags. There's also a new dev release importing comments and keywords. You can test it while I finish the parser.

Please open new issues with concrete problems and don't mix everything. This is not a blog post!

Status: Fixed » Closed (fixed)

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