Forum

Thread tagged as: Problem, Blog, Events

Update to database from 2 to 3. Moved database to a new install of perch 3. Tri...

Latest version of perch and blog and events apps. When I tried to load the blog posts nothing showed up. Same with Events.

What am I doing wrong?

Carol Swinehart

Carol Swinehart 0 points

  • 2 years ago
Hussein Al Hammad

Hussein Al Hammad 105 points
Registered Developer

Hello Carol,

When I tried to load the blog posts nothing showed up. Same with Events.

In your frontend pages or Perch control panel?

Hussein Al Hammad said:

Hello Carol,

When I tried to load the blog posts nothing showed up. Same with Events.

In your frontend pages or Perch control panel?

Perch Control Panel

Drew McLellan

Drew McLellan 2638 points
Perch Support

Do the posts appear in your database?

Drew McLellan said:

Do the posts appear in your database?

Yes they are in the database.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Is the config.php looking for the right database?

Yes it is looking for the right database. I have checked and it is the right database. A backup database to the original site - information is there, new items can be added. Database is working except for the previous items showing up which of course is what I want the most as there are blog posts from 2011.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Do you get any errors in the debug on the page that isn't working?

Drew McLellan said:

Do you get any errors in the debug on the page that isn't working?

Do you mean the cms system page where nothing shows up. Need to put the debug code in or if it is in there how do I activate it?

Here is the result of the test on a page I am not sure where an error might be but nothing that is in the data base is showing on the page.

SELECT u.*, r.* FROM perch3_users u, perch3_user_roles r WHERE u.roleID=r.roleID AND u.userEnabled=1 AND u.userID=1 AND u.userHash='c8b5ab290d99f3aba9be5bc009049834' LIMIT 1 UPDATE perch3_users SET userHash='cf835fff8b7489a72d8a171b4636c91c' WHERE userID='1' [14] SELECT settingID, settingValue, userID FROM perch3_settings WHERE userID=1 OR userID=0 ORDER BY userID ASC [8] SELECT itemValue FROM perch3_menu_items WHERE itemType='app' [1] SELECT * FROM perch3_pages WHERE pageID=3 LIMIT 1 [3] SELECT SQL_CALC_FOUND_ROWS DISTINCT * FROM perch3_content_regions WHERE pageID=3 AND regionPage!='' ORDER BY regionOrder ASC LIMIT 0, 100 [3] SELECT FOUND_ROWS() AS count [1] SELECT mi., p.privKey FROM perch3_menu_items mi LEFT JOIN perch3_user_privileges p ON mi.privID=p.privID WHERE mi.itemActive=1 AND mi.parentID=0 ORDER BY itemOrder ASC LIMIT 0, 1 [3] SELECT mi.*, p.privKey FROM perch3_menu_items mi LEFT JOIN perch3_user_privileges p ON mi.privID=p.privID WHERE mi.itemActive=1 AND mi.parentID=1 ORDER BY mi.itemOrder ASC [1] SELECT itemTitle FROM perch3_menu_items WHERE itemType='app' AND itemValue='content' LIMIT 1 [1] SELECT mi.*, p.privKey FROM perch3_menu_items mi LEFT JOIN perch3_user_privileges p ON mi.privID=p.privID WHERE mi.itemActive=1 AND mi.parentID=0 ORDER BY itemOrder ASC LIMIT 1, 10 [2] SELECT mi.*, p.privKey FROM perch3_menu_items mi LEFT JOIN perch3_user_privileges p ON mi.privID=p.privID WHERE mi.itemActive=1 AND mi.parentID=2 ORDER BY mi.itemOrder ASC File: /core/apps/content/modes/page.post.php [0] SELECT COUNT() FROM perch3_content_items WHERE itemJSON!='' AND regionID=83 AND itemRev=0 [0] SELECT COUNT() FROM perch3_content_items WHERE itemJSON!='' AND regionID=84 AND itemRev=0 [0] SELECT COUNT(*) FROM perch3_content_items WHERE itemJSON!='' AND regionID=85 AND itemRev=0

Hussein Al Hammad

Hussein Al Hammad 105 points
Registered Developer

If you log into the control panel and go to /perch/addons/apps/perch_blog/, what's the debug message at the bottom of the page? Do you see any errors?


Update to database from 2 to 3. Moved database to a new install of perch 3.

If you had a Perch v2 installation, most likely your database tables where prefixed perch2_; you would have this in your config.php:

define('PERCH_DB_PREFIX', 'perch2_');

Since you are working on a fresh install of Perch now and because it is Perch v3, the default database tables prefix is perch3_. From the debug message this the prefix you are using now.

How did you move the database from the old Perch v2 installation to the new Perch v3 installation? If you inspect your database, do you have both tables perch3_blog_posts and perch2_blog_posts?

The files in the database still say perch2_ I moved it by making a copy and putting it into a database of another name since the working site is on that server.

Right now I have two perch licenses. So what do I do now?

Hussein Al Hammad

Hussein Al Hammad 105 points
Registered Developer

From what I understood:

  • You had a Perch v2 site. Let's call this installation (A). You have upgraded (A) to Perch v3.
  • You also have set up a fresh Perch v3 install. Let's call this installation (B).

You wish to transfer the data from (A) to (B). Is this correct?

Hussein Al Hammad said:

From what I understood:

  • You had a Perch v2 site. Let's call this installation (A). You have upgraded (A) to Perch v3.
  • You also have set up a fresh Perch v3 install. Let's call this installation (B).

You wish to transfer the data from (A) to (B). Is this correct?

Yes!!!

Hussein Al Hammad

Hussein Al Hammad 105 points
Registered Developer

Ok.

If you move all the database tables from site (A) to site (B), site (B) would be identical to site (A) - which defeats the purpose of setting up a fresh install.

Is there any reason why you wouldn't keep using site (A)?

Or do you only want to export blog posts and events from site (A) and import them into site (B)?

I want to export blog posts and events from site A and import them into site B -- We are redoing most of the text and the design.

How do I do that?

Hussein Al Hammad

Hussein Al Hammad 105 points
Registered Developer

I think you would need to

  • Export the database tables associated with the Blog and Event apps from site (A). These would be prefixed perch2_blog_ and perch2_events_
  • Import these tables into the database for site (B). You also need to rename the tables so they are prefixed with perch3_ instead of perch2_

Yes, changing the prefixed to perch3_events and perch2_blog worked

Thanks

I think this is the best solution for that. "Update to database from 2 to 3. Moved database to a new install of perch 3." Thank you so much. https://appvalley.one/