On Sat, 24 Mar 2001, Mike Noyes wrote:

> [EMAIL PROTECTED], 2001-03-23 23:39 -0800
> 
> >... omits all user(name?) data?
> 
> Jeff,
> Correct, all of the users data is stripped. There is no user data in the 
> initial table supplied by phpWebSite.

Okay.

> >... hardcoded "leaf" vs $DB?
> 
> It would for our project, but I'm going to write a SF setup FAQ for the 
> phpWebSite project. Other SF projects have long names.

I mean, in one place you used $DB, and in another place you used
"leaf".

> 
> >maybe better to just pipe directly into sed commands to avoid having 
> >unnecessary copies of the database that include the unaltered author data?
> 
> I'll be keeping the unstripped dbase/leaf.sql as a backup for emergencies. 
> I ran umask 077 prior to executing mysqldump. This tarball allows everyone 
> to mirror our site, or play with the content on a local machine.

Reasonable.

> >this seems odd... if there are more entries in the authors table than just 
> >admin,
> 
> There are.
> 
> >they will be reduced to just admin (with a bunch of failed
> >duplicate inserts)
> 
> Correct, but I don't understand your comment about "failed duplicate 
> inserts". Did I do something wrong? The test.sql output looked correct.

I have never seen the "INSERT INTO ... (), (), (), ..., ();" extension of
the INSERT command before.  I always saw one insert for each row.

> >is it really a good idea to lose author attribution? are there any foreign 
> >keys depending on entries in this table? maybe better just to "fix" their 
> >password to a dummy in the copy? I am not familiar with the schema, so I 
> >don't know what else might be a problem, but whatever you do, try it and 
> >load it into a temporary partition to verify that it works rather than 
> >depending solely on eyeball review...
> 
> I already checked that sed was doing what I wanted before posting. However, 
> I haven't tried to use it on another site.

I am still concerned about the loss of author attribution information.  
The "stories" table uses the "aid" variable.

I have since looked closer at MySQL, and they claim that if you want to
maintain relations, it is more efficient for the application programmer to
do this than for them to put foreign key enforcement in the database.  
Regardless of whether this is right, you have broken this relationship.

If the "pwd" field is the author password, then substituting a single
default password for each password would seem to be more appropriate.

If there are no quoted single-quotes in the author fields, the following
should do it:

sed -e
"/INSERT/s/\((\('[^']*',\)\{4\}\)'\([^']*\)',\([^)]*\)/\1'dummy',\4\)/g"

---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<[EMAIL PROTECTED]>        Basics: ##.#.       ##.#.  Live Go...
Work:<[EMAIL PROTECTED]>              Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...2k
---------------------------------------------------------------------------


_______________________________________________
Leaf-devel mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/leaf-devel

Reply via email to