1

I have a craft CMS 2 codebase that a former developer had made for running on our PHP 5 server. Recently, the server upgraded its PHP version to 7.3 so I am trying to migrate the website to a later version of CMS 2 or CMS 3 that will operate on PHP 7.3. I am not sure what version of Craft was used to develop the website. Any advice on how to figure that out is appreciated. The website was made in 2014 and this is the project structure.

Project structure

My questions are:

  1. Would it be easier to upgrade to a later version of craft CMS 2 or CMS 3
  2. How can I migrate the database or content? I have seen example of migrations from Craft 2.6 to Craft 3 but I don't think that applies because this is an early version of Craft 2.
  3. Any tips on how to run the codebase on PHP 5. I have tried running the codebase on PHP 5.3-5.5 with empty databases and the imported database file but I kept getting internal or server errors.

The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script.

If you think this is a server error, please contact the webmaster.

Object not found! The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.

If you think this is a server error, please contact the webmaster.

Any advice appreciated or a link to pre-made database migration scripts. As of now, I am thinking it is possible to copy the content from the database file but that would involve a lot of manual work.

1

Would it be easier to upgrade to a later version of craft CMS 2 or CMS 3

Craft 3 was a major rewrite of the entire platform, so it will definitely be a lot easier to upgrade to a later version of Craft 2. In fact, you're probably going to have to upgrade your Craft 2 install regardless of whether you want to move forward to Craft 3 eventually, since it's not possible to upgrade sites on very old Craft 2 versions to Craft 3. Assuming the site hasn't been updated since 2014, you're probably going to be on Craft 2.3-something, and the latest Craft 2 version (which is the one you should upgrade to) is 2.9.2.

Once you've got your Craft 2 install upgraded, it's worth noting that Craft 2 itself is quite outdated at this point, and will reach its final end-of-life in January 2022 (that means no support or security patches). If the site is relatively simple and doesn't have any bespoke plugins, it might be worth it to upgrade to Craft 3 after upgrading to the latest Craft 2 version.

Another thing to be aware of is that while Craft 2.9.2 itself will be PHP 7.3 (and 7.4) compatible, some of the plugins you might have installed might not be. So make sure to upgrade any and all plugins to their latest version as well. You'll find a link at the bottom of the control panel to the Updates section inside Craft; that should list any available upgraded versions for your installed plugins. Craft 3 makes this process a bit easier by enabling you to upgrade plugins via the control panel, but for Craft 2 this will be a manual process.

How can I migrate the database or content? I have seen example of migrations from Craft 2.6 to Craft 3 but I don't think that applies because this is an early version of Craft 2.

Craft will migrate your content automatically for you, when you upgrade (even when moving from Craft 2 to 3). You shouldn't need to do anything manual here, unless you've got some bespoke plugins that interface with the database at all.

Any tips on how to run the codebase on PHP 5. I have tried running the codebase on PHP 5.3-5.5 with empty databases and the imported database file but I kept getting internal or server errors.

Craft 2 (all versions) require PHP 5.4 or newer, so it's not going to run on 5.3.

The errors you're getting sound like server configuration errors though, probably not PHP compatibility issues. It also sounds like you're using Apache, so your issue is probably going to be in your .htaccess file. A quick thing to try is if you have a file called htaccess (without the dot) in your public folder. If that's the case, rename it to .htaccess (with a dot). Beyond that, check out https://craftcms.com/docs/2.x/installing.html for pointers on how to get Craft 2 to run.

3
  • Thanks. This was very insightful. I was able to see the homepage without styling and images after removing some of the junk that was in .htaccess. Given that none of the links work, styling is not present, and I can't access the admin panel I am inclined to believe one of the path variables must be misconfigured for running the website locally as opposed to its original location on a server. I get this as an error message when trying to access admin page: Object not found! The requested URL was not found on this server. If you entered the URL manually please check your spelling...
    – Joseph D
    Nov 15 '21 at 19:23
  • Any advice on other ways to access the admin panel because that's what I need to access to update craft from my understanding. I have tried variations of index.php/admin found here (craftcms.com/knowledge-base/…). Also, the Craft version is 2.0.2.
    – Joseph D
    Nov 15 '21 at 19:25
  • The .htaccess file that ships with Craft 2 doesn't have a lot of junk, so I'm assuming you're working with an edited version. Try using the one that ships with the latest version of Craft 2 (download.craftcdn.com/craft/2.9/2.9.2/Craft-2.9.2.zip), and go from there? Beyond that, you might want to join the official Craft Discord – there's a dedicated Craft 2 community help channel, which is probably a better place to get help with the gritty details. Nov 16 '21 at 0:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.