Forum

Thread tagged as: Problem, Error, Installation

Perch v1 to v2 Upgrade app issues with Content and Gallery import

Hi Guys,

I am upgrading a perch installation from V1.8.4 to the latest V2 version.

I've followed the upgrade instructions in the docs and I am getting the below errors, with debug switched on, when trying to import the content and the galleries / image respectively.

It looks like there are missing columns on the tables which leads me to believe (for the gallery anyway) that the version I am trying to upgrade from is too old. Not sure about the content table issue.

Content Migration Error:
SELECT * FROM perch_contentItems WHERE contentPage='/about.php' ORDER BY contentOrder ASC
Invalid query: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'contentOrder' in 'order clause'

Gallery Migration Error:
SELECT * FROM perch_gallery_images WHERE albumID=195
Invalid query: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'albumID' in 'where clause'

Any suggestions?

Thanks,

Alex

Alex Tebbutt

Alex Tebbutt 0 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Was the Perch 1 installation functioning correctly as 1.8.4? How long was it at 1.8.4 before upgrading?

Hmmm, at least 2 years I think. And yes, everything was working as it should on the old version.

Drew McLellan

Drew McLellan 2638 points
Perch Support

That's odd. Can you try running the update script on the 1.8.4 installation?

Hi Drew,

I'm not sure I understand. I installed v2 and then upgraded. Do you mean install the gallery against v1.8.4?

I also have the issue where the content table is missing the contentOrder field.

Should this have been present in v1.8.4?

If so do you have a version of that I can try to reinstall?

Thanks,

Alex

Drew McLellan

Drew McLellan 2638 points
Perch Support

It's the contentOrder field problem I'm trying to diagnose. The error refers to the Perch 1 database table perch_contentItems. It's missing a column which the 1.8.4 update script (the script you used to run on Perch 1 when updating) would fix.

OK, I've just done a clean install of perch 1.8.4 and that has 2 new fields compared to the existing site (contentOrder and contentSearchable), so I'll re-run the install on the problem site and see where that gets me.

It's odd as I checked the version of Perch on the site before upgrading to v2 and it did say 1.8.4!

Are the old (v1) Perch docs available, I need to have a look at the upgrade instructions as I can't remember which folders I need to replace...

Drew McLellan

Drew McLellan 2638 points
Perch Support

Right, that's worked. Not sure what was going on but the content items have now imported.

The last thing are the images in the gallery. The albums have come across but the images are still missing.

The error is the same as before:

Gallery Migration Error:

SELECT * FROM perch_gallery_images WHERE albumID=195
Invalid query: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'albumID' in 'where clause'
Drew McLellan

Drew McLellan 2638 points
Perch Support

Which version of Gallery are you importing from?

Hi Drew,

I'm not sure and the diagnostics don't tell, I do know that I installed the blog v1.2 and twitter v1.1 at the time if that's any help.

Thanks,

Alex

Drew McLellan

Drew McLellan 2638 points
Perch Support

It's not much help! Was it the latest version for Perch 1?

Hi Drew,

No it wasn't. It would have been the latest for v1.6.5.

If you have the latest at the time v1.8.4 was out I can install that and hopefully everything we be as it sorted.

Thanks,

Alex

Drew McLellan

Drew McLellan 2638 points
Perch Support

Sure - it's all on the site: https://grabaperch.com/add-ons/archive/apps

Hi Drew,

I've installed the last compatible version of the gallery against the v1.8.4 installation and I can't see the image in Perch anymore.

Navigating to the gallery pages show all albums with 0 images in them. The link between the two appears to have been lost.

I've tried the upgrade of the gallery locally and on a subdomain on my host and I'm getting the same issue.

Any ideas?

Thanks,

Alex

Hi again Drew,

I've debugged the gallery section and it's the same issue, the perch_gallery_images table is missing the albumID field.

SELECT COUNT(*) FROM perch_gallery_images WHERE albumID = '235'
Invalid query: Unknown column 'albumID' in 'where clause'

Was there a specific version of the gallery app that added this in?

Thanks,

Alex

Drew McLellan

Drew McLellan 2638 points
Perch Support

I wonder if you had Gallery v1, which wasn't upgradable to v2.

Hi Drew,

That's very possible. So there's no migration path from the old version of the gallery to the new?

Do any of the columns in the tables map between the two versions as I could have a go at writing a custom script to migrate them.

Thanks,

Alex

Quick question: Does the v1 gallery work with Perch v2?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Gallery v2 required a minimum of Perch v1.8, so it's looking more likely that you were on Gallery v1:

https://grabaperch.com/blog/archive/supercharging-the-gallery-app

Some of the data will map. As we're talking about something that happened 3 years ago, I'm not overly fresh on what the differences were. I suspect the template-driven image sizing made it impractical to migrate in any way that would work on restricted shared hosting, as it would have needed to do bulk image processing.

How many images do you need to migrate?