Closed (fixed)
Project:
SPIP to Drupal
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Reporter:
Created:
1 Mar 2009 at 23:10 UTC
Updated:
18 Mar 2010 at 11:10 UTC
Jump to comment: Most recent file
Comments
Comment #1
jonhattanPlease report your spip version in order to try to reproduce the error.
Comment #2
jonhattanI'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 :)
Comment #3
dorian670 commentedHi,
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
Comment #4
dorian670 commentedI 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
Comment #5
jonhattanIt's not a tar file buz a gzipped one.
Comment #6
elektrorl commentedit does not work:
propre.php gives:
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!!!!!
Comment #7
jonhattanIf 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
Comment #8
mediacteurs commentedHello,
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.
Comment #9
dorian670 commentedHi,
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
Comment #10
rfabbri commentedI'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...
Comment #11
plsk commentedJe 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
Comment #12
jonhattanplsk: 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.
Comment #13
dorian670 commentedThe 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 ;;
Comment #14
dorian670 commentedHi,
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
Comment #15
dorian670 commentedHi,
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
Comment #16
Countzero commentedThanks 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.
Comment #17
Countzero commentedI 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.
Comment #18
Countzero commentedOK, 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.
Comment #19
stijn vanhandsaeme commentedhi 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.
Comment #20
stijn vanhandsaeme commentedok i got it working by disabling spip-listes plugin. thanks!
Comment #21
stijn vanhandsaeme commentedi'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.
Comment #22
stijn vanhandsaeme commentedalright, i got it working by adding these two lines i think:
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)
Comment #23
dorian670 commentedHi,
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
Comment #24
bionet commentedHello,
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
Comment #25
dorian670 commentedHi,
What's the folder's name of the biotech site ? /homez.16/biotechn/www/biotech.fr ??
Comment #26
MarcAtQuod commentedHello,
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 :
And :
In the DB :
and the datas - spip_rubriques :
So : nothing running well....
Comment #27
jonhattantry disabling plugins.
Comment #28
MarcAtQuod commentedAs 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
Comment #29
MarcAtQuod commentedHello,
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...
Comment #30
jonhattanThe 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!