Although I will be changing the database schema, I am also in the process of writing a new install tool that will offer the ability to migrate your database to the new schema. Oh, and you won't have to edit PHP files anymore before starting the install. It just walks you through that process and writes your init file for you.
I just ran the migration on a clean install of US3, and upgraded to US4, so the process itself works, granted this is a highly idealized example. There are a few things that could likely be improved, but a big upgrade is always best to play on the safe side and force some things to remain manual.
I did one today too - the DB upgraded perfectly.
The change in file structure would mostly break the example I upgraded so I ended up backing out of it.
3.x is so inviting, people will have made edits to the core that might make the upgrade rather hazardous.
//If you got a notification from a different username, I had to kill off a couple of accounts that were trying to attack the site. We got a mini DOS attack today. Everything seems fine now.
The great thing is that there’s nothing wrong at all with UserSpice 3. If people want to do things procedurally, it’s a great choice. On top of that, if they get one of the later versions with the nice dashboard and the new classes, they can even do their own oop queries. I need to do a better job of documenting the upgrade process.
The general rule of thumb is…
1. All the “userspice” pages are new so you would lose any changes if you modified yours.
2. Anything you wrote on your frontend will work fine with a few caveats.
a. If you’re making calls using the old built in functions that look for the logged in user. It will need to be updated. Basically
if(isUserLoggedIn()) {
becomes
if($user->isLoggedIn()) {
b. If you are using US3 procedural ways to echo out things like the user name, you have to use the new OOP way of doing that. by default it’s
<?=$user->data()->username?> or whatever you want to echo out.
3. I meticulously rewrote every single function that US3 actually used into OOP/PDO PHP. So the biggest thing you’ll get is that if you were (and you probably weren’t) using US3’s built in functions, you might receive an object back instead of an array and might need to update a bit. For the most part, though, people seemed to build their own db classes and things like that and US4 will play nicely with those. Especially if you’re willing to call your db variable anything other than $db.
This is a problem with any major upgrade of any software (well, except for Windows 10...I wish it WASN'T free so they would stop bugging me). I'm glad I was able to start a clean slate with US4. For the most part, I don't touch any US files so that definitely makes things easier. For the most part, I'm also doing my own database queries since I need to for my own application anyway and all in all, they play very nicely together.