[solved] Can't create new pages after importing content into database

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
stevehong
New Member
New Member
Posts: 9
Joined: Sun Jul 23, 2006 7:54 pm

[solved] Can't create new pages after importing content into database

Post by stevehong »

Please help if you can.  I need to import almost a thousand pages of content into a CMSMS site, and I thought I knew how, but after importing pages directly into my database by inserting new rows, I can't properly create new pages in the CMSMS Admin Panel.  The problem appears to be that pages created in the Admin Panel are given sequential content_id values in the database.  I thought that CMSMS wouldn't try to use numbers of rows that already existed in the database (rows that I imported), but it does.  And the Admin Panel-created page doesn't even completely overwrite the database-imported page; only the database rows in the cms_content_props table are overwritten, and the cms_content table is left alone, meaning the hybrid page has the imported title but new content.  In short, I can import hundreds of pages into my database, but the site content will slowly fall to pieces and be partially overwritten as I use the CMSMS Admin Panel to create new pages.

Is there a way to fix or work around CMSMS' inability to assign truly unique content_id numbers to new pages created in the Admin Panel?  Is there a way to force the CMSMS Admin Panel to start using content_id numbers beginning at an arbitrarily high number to avoid interference with imported database rows?  Is there another way to import Excel/CSV data without interfering with CMSMS ability to update the pages?

Here is some additional background if it helps:
First, I'm mostly a front-end HTML and graphics guy, so I don't have much knowledge or experience working with databases or server-side scripting.  Please try to explain any answers to my question simply or with lower-tech options when possible.  I am using CMSMS 1.0.8 "Kona" and phpMyAdmin 2.8.0.1.  This is the first time I have tried editing a database using phpMyAdmin.

I imported data from an Excel spreadsheet that was converted to CSV format.  I was very careful to observe and figure out how to properly place data into columns that matched the database, so I'm reasonably certain that I correctly imported data.  The imported pages show up correctly in my site's navigation and in the CMSMS Admin Panel list of pages.  I think I properly advanced id and hierarchy number values.  I only added rows to the cms_content and cms_content_props tables.
Last edited by stevehong on Mon Aug 06, 2007 9:07 pm, edited 1 time in total.
tsw
Power Poster
Power Poster
Posts: 1408
Joined: Tue Dec 13, 2005 10:50 pm
Location: Finland

Re: Can't create new pages after importing content into database

Post by tsw »

page id's are generated according to value in cms_content_seq table (this is because some sql servers had problems with autoincrement columns)

UPDATE cms_content_seq SET id=(SELECT MAX(content_id) FROM cms_content);

should fix it.
stevehong
New Member
New Member
Posts: 9
Joined: Sun Jul 23, 2006 7:54 pm

Re: Can't create new pages after importing content into database

Post by stevehong »

Thanks, tsw.  That's exactly what I needed to know.  I'm going to set the id of cms_content_seq to 1000 so I can import all of my content and not worry about id numbers conflicting.
Post Reply

Return to “CMSMS Core”