Upgrading from 3.0.5

<%- if @topic_view.topic.tags.present? %>
<%= t 'js.tagging.tags' %>: <%- @topic_view.topic.tags.each do |t| %> <%= t %> <%- end %>
<% end %>

Silverstripe Version:
3.0.5 not installed with composer.

Question:
I have been asked to upgrade a fairly old SS site to one compatible with PHP 7.3, I am NOT an SS user. I have read lots of documentation but am not really getting anywhere. I have tried upgrade-code.phar, but it doesn’t like the setup, I installed composer but it says I have to fix conflicts but it doesn’t say what they are. Any assistance would be much appreciated.

You’d need to go from 3.0 to at least 3.7 to get PHP 7 compatibility and that can get pretty messy. I don’t think Silverstripe CMS had adopted SemVer yet back in 3.0 days, so you may encounter breaking changes and need to rewrite code. It’s probably going to be quite a big and frustrating job, and it’s hard to know where to begin when offering support on a forum for something like this which may be why you haven’t had a response yet. To be honest I would recommend outsourcing this work to an experienced SS dev, then you could maintain it once it’s in a modern and manageable state. You can find a list of SS devs and businesses here if you’re interested:

Looking at this site’s content, I am actually surprised it was implemented using a CMS in the first place. I doubt whether there is any custom code. I am wondering whether I can simply install a more recent release over the top of what is there.

[agree-10]lpg: ls
assets/ index.php phpunit.teamcity.postgresql.xml test.php
cms/ install-frameworkmissing.html phpunit.teamcity.sqlite3.xml themes/
CONTRIBUTING.md Makefile phpunit.teamcity.xml upgrade-code.phar*
favicon.ico mysite/ phpunit.xml.dist vendor/
framework/ phpunit.teamcity.mssql.xml README.md web.config
[agree-10]lpg: ls mysite
code/ _config.php
[agree-10]lpg: ls mysite/code
ContactPage.php Page.php
[agree-10]lpg:

Want to post a screenshot of the root directory? That will show what additional modules may be installed (if any). User code is in a folder named ‘mysite’ by default, but it may have been renamed to describe the project. If there isn’t any custom code in there then sure, you could try installing SS3.7 fresh, replace the assets folder with the one from your project, import the database in to that new project, build and see what happens!

That looks like a super basic site. I would just do a clean install of SS3.7 and copy over the assets, themes and mysite folders and DB. You might need to do some light changes to the files in your mysite folder but probably not much.

I’ll give that a go. As I said, I dont know why they used a CMS in the first place.

Where can I get SS3.7?

Site seemed to be OK in admin stuff, but I had to change a bunch of ‘public’ to ‘private’ in mysite/code/Page.php

So I now get

Server error

Sorry, there was a problem with handling your request.

Not sure how to debug from here

Try composer create-project silverstripe/installer ./my/website/folder 3. See

I now have the main site working but are getting the server error immediately on trying to login /Security/LoginForm

I cant find any logs anywhere so have no clues yet.

Should be some clues in your php error log. Or you could turn error displays to on in your PHP config or if you’re developing locally, install xdebug.

Without any error details it’s going to be very difficult to debug. You could try enabling SS logging to a file or email, but if the error happens very early it might not get through. https://docs.silverstripe.org/en/3/developer_guides/debugging/error_handling/

Are you doing this on a live server? Generally it’s better to do this kind of work locally first if possible, then push up when ready. This might help to find the error log: https://stackoverflow.com/a/5127884/2494302

The database schema would appear to need updating as the log shows various columns missing from tables. Is there a script to get from 3.0.5 to 3.7.0 ?

Did you do a dev/build? Sorry, some things are so ingrained in SS development that I forget to mention them :smile:. After changing your code (or database in this case) you generally need to either visit ‘mysite.com/dev/build’ to flush all caches/manifests and build the database, or append ?flush to any URL on your site to just flush the manifests. You’d definitely need to do a build after importing a SS3.0 database in to a SS3.7 site.

That seems to have fixed things :slight_smile:-)
We host, Drupal, Joomla, WP, SS, etc etc and I am no expert in any of them but in most cases I know more than the end user. We are trying turn off PHP 5 and I have customers who really have no clue at all.

Thanks very much for your patience and assistance. Hopefully we are all done now.

1 Like