<HTML>
<HEAD>
<TITLE>Re: [consulting] Database migration script or copy/paste?</TITLE>
</HEAD>
<BODY>
<FONT FACE="Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12.0px'>Victor, <BR>
<BR>
Thanks. That sounds incredible. I totally agree with you. I’m fine spending hours setting up an automated system that works because just with the few sites that I’ve done I’m disgusted that it takes so long to insert content.<BR>
<BR>
Holly<BR>
<BR>
<BR>
On 4/20/10 6:01 AM, "Victor Kane" <victorkane@gmail.com> wrote:<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12.0px'>You will save a great deal of time with the mis-named "Node Export" module: drupal.org/project/node_export <a href="http://drupal.org/project/node_export"><http://drupal.org/project/node_export></a> <BR>
It also handles bulk export, import, and I have used it to import thousands of nodes stored in a CSV format.<BR>
But, as Khalid says, there are no pictures or node references; from the project page:<BR>
<BR>
"Since the bulk export feature has been added, a lot of people have assumed this module will allow you to export the structure of a whole site and keep things like menu links, authors, node references, book hierarchy, etc.. BUT NO IT DOESN'T. The reason is that the ID values that are used to identify the connections between things like that get changed around during an import. There are hooks that allow manipulation of nodes during imports/exports that could allow a programmer to add support for these features by tracking additional data to be able to fix the nodes afterwards, but nobody has gone to the trouble of doing that yet."<BR>
<BR>
It is indeed amazing that no-one has gone to that trouble, or has shared solutions. For complex data structures, there is the migration module and the table wizard, which were designed for huge sites, and which the makers chose to share.<BR>
<BR>
The node_import module might be of use also, or roll your own script based on many snippets in the Drupal handbook and around the web.<BR>
<BR>
This discussion on drupal.org <a href="http://drupal.org"><http://drupal.org></a> sums the "state of the art" perfectly:<BR>
<BR>
drupal.org/node/762022#comment-2806388 <a href="http://drupal.org/node/762022#comment-2806388"><http://drupal.org/node/762022#comment-2806388></a> and refers you to the discussion where there are some examples: drupal.org/node/178506 <a href="http://drupal.org/node/178506"><http://drupal.org/node/178506></a> (creating a node programmatically). <BR>
<BR>
Also: acquia.com/blog/migrating-drupal-way-part-i-creating-node <a href="http://acquia.com/blog/migrating-drupal-way-part-i-creating-node"><http://acquia.com/blog/migrating-drupal-way-part-i-creating-node></a> <BR>
<BR>
The import_html module is an option, but it brings a lot of overhead into the site in my opinion.<BR>
<BR>
A script to import static HTML would work by iterating over the files in a directory and then using common PHP functions to read in the text, and then extracting the body and sticking it into the body of the Drupal node. You can use a regular expression for that, or, this module is very interesting: drupal.org/project/querypath <a href="http://drupal.org/project/querypath"><http://drupal.org/project/querypath></a> <BR>
Based on a "scraper" kind of program, It allows an "xpath" like approach for common html files. Check it out.<BR>
<BR>
Any of these approaches are better than copying and pasting. A developer needs to shun copying and pasting. Even if you spend more time automating the process than brute force, you will have reusable tools.<BR>
<BR>
Victor Kane<BR>
<a href="http://awebfactory.com.ar">http://awebfactory.com.ar</a><BR>
<a href="http://projectflowandtracker.com">http://projectflowandtracker.com</a><BR>
<BR>
On Tue, Apr 20, 2010 at 2:17 AM, Holly Ferree <hferree@gmail.com> wrote:<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12.0px'>Hi Bob,<BR>
<BR>
Thanks for the input. I'm not web to scripts... I just didn't know what else<BR>
to call them... I just want to know if there is a better way to insert a lot<BR>
of content without so much clicking and copying/pasting. :)<BR>
<BR>
I am so thrilled to know about all these modules that I can try!<BR>
<BR>
I was curious if Excel could be used (it's all tables anyways)... Would you<BR>
export it was a .csv?<BR>
<BR>
Thanks,<BR>
<FONT COLOR="#888888">Holly<BR>
</FONT><BR>
<BR>
On 4/20/10 12:12 AM, "Bob Schmitt" <bobschmitt@xinsys.net> wrote:<BR>
<BR>
> I've had pretty good luck with the Import/Export module<BR>
> (<a href="http://drupal.org/project/import_export_tool)">http://drupal.org/project/import_export_tool)</a> and the Node Export module<BR>
> (<a href="http://drupal.org/project/node_export).">http://drupal.org/project/node_export).</a> I can't remember which one is the<BR>
> best, but I have used them to dump/import more than 30K nodes organized in in<BR>
> 7 cck node types. It worked pretty well except for importing multiple taxonomy<BR>
> terms per node.<BR>
><BR>
> I've also used these modules to migrate content from other sites into Drupal<BR>
> sites using Excel and FilemakerPro as intermediary platforms to massage the<BR>
> data into the correct formats prior to the migration.<BR>
><BR>
> Strictly speaking, neither of these are database migration scripts, but the<BR>
> get the job done.<BR>
><BR>
> bob<BR>
><BR>
> On Apr 19, 2010, at 9:11 PM, Holly Ferree wrote:<BR>
><BR>
> Hi All,<BR>
><BR>
> What is the most efficient way of transferring a site's content of 10 pages<BR>
> or more into drupal? (basically past the realm that you would want to copy<BR>
> and paste all the content to where another option would be easier to add a<BR>
> good amount of content would be the way to go)<BR>
><BR>
> I have done the copy/paste of hundreds of lines of content from Word and<BR>
> done the whole create content > page, paste and format content, save page,<BR>
> repeat process till I thought I would die of boredom...<BR>
><BR>
> Please tell me there is a better way! (these sites have been from scratch or<BR>
> have not used a database previously. )<BR>
><BR>
> Thanks,<BR>
><BR>
> Holly Ferree, Graphic Designer, BFA<BR>
> hferree@gmail.com<BR>
> <a href="http://www.designbyholly.com/">http://www.designbyholly.com/</a><BR>
><BR>
><BR>
> PS I would also prefer to do it myself and not hire someone who doesn't mind<BR>
> repetitive work... :)<BR>
><BR>
><BR>
> _______________________________________________<BR>
> consulting mailing list<BR>
> consulting@drupal.org<BR>
> <a href="http://lists.drupal.org/mailman/listinfo/consulting">http://lists.drupal.org/mailman/listinfo/consulting</a><BR>
><BR>
> Bob Schmitt<BR>
> 432 Harrison Ave.<BR>
> Helena, MT 59601<BR>
> Voice: +1.406.459.6537<BR>
> Skype: captbobalou<BR>
><BR>
><BR>
><BR>
> _______________________________________________<BR>
> consulting mailing list<BR>
> consulting@drupal.org<BR>
> <a href="http://lists.drupal.org/mailman/listinfo/consulting">http://lists.drupal.org/mailman/listinfo/consulting</a><BR>
<BR>
Holly Ferree, Graphic Designer, BFA<BR>
hferree@gmail.com<BR>
<a href="http://www.designbyholly.com/">http://www.designbyholly.com/</a><BR>
<BR>
<BR>
_______________________________________________<BR>
consulting mailing list<BR>
consulting@drupal.org<BR>
<a href="http://lists.drupal.org/mailman/listinfo/consulting">http://lists.drupal.org/mailman/listinfo/consulting</a><BR>
</SPAN></FONT></BLOCKQUOTE><FONT FACE="Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12.0px'><BR>
<BR>
<HR ALIGN=CENTER SIZE="3" WIDTH="95%"></SPAN></FONT><FONT SIZE="2"><FONT FACE="Monaco, Courier New"><SPAN STYLE='font-size:10.0px'>_______________________________________________<BR>
consulting mailing list<BR>
consulting@drupal.org<BR>
<a href="http://lists.drupal.org/mailman/listinfo/consulting">http://lists.drupal.org/mailman/listinfo/consulting</a><BR>
</SPAN></FONT></FONT></BLOCKQUOTE><FONT SIZE="2"><FONT FACE="Monaco, Courier New"><SPAN STYLE='font-size:10.0px'><BR>
<BR>
</SPAN></FONT></FONT><FONT FACE="Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12.0px'>Holly Ferree, Graphic Designer, BFA<BR>
813.786.0852<BR>
hferree@gmail.com<BR>
<a href="http://www.designbyholly.com/">http://www.designbyholly.com/</a><BR>
</SPAN></FONT>
</BODY>
</HTML>