Page 1 of 1

Importing < Pivot 2.0 db/

PostPosted: Mon Nov 26, 2007 3:29 pm
by bramn
Importing your old pre-2.0 database can't be easier, just copy all of the standard-xxxx directories in your old pivot/db/ folder to the new db/ folder. However, since PivotX uses a new category system with display names, the old entries aren't automatically added to the correct category after manually adding the 'old' categories.
For instance, my old category was called 'Life' and is called, after manually adding it in PivotX, 'life' (all small caps). Is there a way to mass-add them to the right category?

Re: Importing < Pivot 2.0 db/

PostPosted: Mon Nov 26, 2007 3:58 pm
by Bob
If i remember correctly, after conversion, all entries are added to 'life' (in your case), and it makes a 'life' category.. Now, you can go to the categories and set the display name for category 'life' to 'Life', so it will be displayed correctly on your site.

Or, does it go wrong in conversion, and did you get a mismatch? If so, we can do two things:
- I'll fix the conversion script, and you can try again
- Use Phpmyadmin to change them all in the DB to set them right.

Re: Importing < Pivot 2.0 db/

PostPosted: Mon Nov 26, 2007 4:32 pm
by bramn
Euhm I did not use any script, I just copied the standard-xxxxx myself. Is there a conversion/import script? I thought there was only one to convert to the new MySQL format?! Or did I miss something?

Re: Importing < Pivot 2.0 db/

PostPosted: Mon Nov 26, 2007 4:35 pm
by Bob
Ah, my bad! I assumed you converted them to MySQL.. Flat File entries don't have to be converted, you just might need to rebuild the index. (which i assume you did)

But, i'm still not sure what the issue is.. :-) Where does it go wrong? Can't you fix it by setting the 'display name' for the category?

Re: Importing < Pivot 2.0 db/

PostPosted: Mon Nov 26, 2007 5:35 pm
by bramn
That's just it, the old category name is not being compared to the 'Display name', but apparently to the 'Name'. Of which the latter I can't set the same, because it is automatically turned to lowercase :)

Re: Importing < Pivot 2.0 db/

PostPosted: Mon Nov 26, 2007 11:43 pm
by hansfn
I know what is going, but let me first ask you why you
manual added the 'old' categories.

A-ha, I just understood (while writing this) - you just copied the db/standard-xxxxx folders and not the two old config files, pv_cfg_settings.php and pv_cfg_weblogs.php. PivotX will pick up the old categories and weblog settings if these two config files are present.

Anyway, the problem is that PivotX stores all categories with lovercase (internal) names. It means will have to write a tiny conversion script, looping over all entries and lower casing the category names. I'll do it tomorrow.

Re: Importing < Pivot 2.0 db/

PostPosted: Tue Nov 27, 2007 5:13 pm
by bramn
Yup, you understood me correct. But if I understand correctly I can also just copy my old pv_cfg_* files? Or is it too late for that now ;)

Re: Importing < Pivot 2.0 db/

PostPosted: Tue Nov 27, 2007 7:41 pm
by hansfn
It's not too late. Just remove db/ser_weblogs.php and db/ser_categories.php, and PivotX will try to read the old config files. (The "lowercase category names in entries"-script will have to wait until tomorrow.)

Re: Importing < Pivot 2.0 db/

PostPosted: Tue Nov 27, 2007 10:31 pm
by bramn
Worked like a charme indeed! Will this be the 'official' method of importing old entries when PivotX gets out of alpha/beta? :)

Re: Importing < Pivot 2.0 db/

PostPosted: Wed Nov 28, 2007 9:20 am
by hansfn
Yes, probably. We have discussed moving the "read old config" code out of the core and into a separate script - I wanted the code to be as clean as possible. On the other hand, it's kind of nice the way it is now.