Cannot redeclare perch_page_modified after upgrading from V2 to V3 due to PHP 7 upgrade

  • Upgrade instructions look pretty easy. We have no apps, no templates or addons... we don't do anything fancy... straight out of the box. We started with 2.8.15 but upgraded to 2.8.32 in the past. Did the backups. Testing locally so domain is 127.0.0.1. Downloaded perch 3.1.4. Replaced perch/core. Deleted perch/addons/plugins/editors/markitup


    Executed 127.0.0.1/perch which picked up that it was an upgrade. Continued. OK. We note that the table names still have a prefix of perch2!


    Went to 127.0.0.1 and we got 'Fatal error: Cannot redeclare perch_page_modified() (previously declared in /var/www/html/perch-en/core/apps/content/runtime.php:601) in /var/www/html/perch-en/core/apps/content/runtime.php on line 601'


    Any ideas would be appreciated.

  • Further to the original post. The table prefix sentence was wrong. The 21 perch2_ tables are still there and there are also 12 perch3_ tables there, but they contain no records. If we define the prefix as perch2 in the config file, accessing the website works and also we can login to the cms. We have not tested further. Obviously, if the prefix is perch3 it bombs.

  • drewm

    Approved the thread.
  • We note that the table names still have a prefix of perch2!

    Yes, we don't rename the tables at that point. That would be totally unnecessary. The prefix is stored in the config file, so we just keep it the same.


    Went to 127.0.0.1 and we got 'Fatal error: Cannot redeclare perch_page_modified()

    Did you update your config/apps.php to the new format?