Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Upgrading From Version 2.0.18.1

I'm planning on migrating my forum over to a new host very soon, and figured that while I'm at it, I should look into upgrading it. I'm wondering if it's even possible to upgrade to the newest version (2.6) or not, considering mine is very old. As of now, I have everything setup perfectly, in the sense that plugins work cohesively and error-free, and i'm sure most of these plugins won't be able to be transferred over, but that's fine, and I'll work around it. Also, since I'm not having any errors at all, maybe it's just best to keep it the way it is? Any feedback is appreciated, thanks!

«1

Comments

  • @StaticCory

    Welcome to the community.

    You absolutely should upgrade.

    There are numerous serious security issues which have been patched over the intervening versions.

    Ideally you would set up a clone of your current version, so you could experiment with upgrading without affecting your live forum.

    Since you say you are planning on switching hosts, it might make sense to set that up on your new host's servers.

    Ask away on here if you run into any issues.

  • R_JR_J Admin
    edited June 2018

    I suggest to make a clean install of vanilla 2.6 and afterwards change the database settings in you config to point to a cool of your old database. Run /utility/structure and add the event version of the plugins that you have used before

  • Thanks for the quick response, guys!

    I'm so glad that it's actually possible, I was afraid I wouldn't be able to.

    Last time I moved my forum to a new host was years ago, and i'm definitely a little fuzzy on the process. I don't remember if I transferred only certain files/folders to the new install location, or if I just transferred the whole entire forum contents. I do remember having to use the same mysql database, and deleting cache in certain areas. I assume that this process may be different though, and maybe only certain things can be transferred over, and all of the plugins probably have to be updated to new ones.

    Can you guys help with which files are of key importance, and maybe a refresher on the transfer process? Thanks!

  • whu606whu606 MVP
    edited June 2018

    What you HAVE to have is your mySQL database. That contains all the key information - users/threads/posts etc.

    Depending on who you are currently hosting with, there may be a cPanel tool to export it, or you can use something like phpMyAdmin.

    You may also want the contents of your uploads folder, which would have user avatars and any uploaded images.

    You might also want any custom plugin from the plugins folder, but as you suggested, they are unlikely to work with 2.6 (at least without some alteration, depending n their complexity.)

    Keep a copy of these somewhere safe, as well as transferring them to your new host.

    That done, you then have 2 choices:

    Either: copy over the entire folder/sub-folders of your current Vanilla installation (this would already include your uploads and plugin folders)

    Clear any ini files from the cache folder, and you should have a clone of your current site (assuming the db details remain the same. Otherwise you'd need to edit the details in the conf.php folder.)

    Or: set up a clean install of Vanilla 2.6 with a new database.

    Once the installation has finished, change the details in conf.php to point to your old DB, and run /utility/structure

    That should then show your old forum posts in a Vanilla 2.6 forum.

  • Thanks whu606, very detailed.

    My cpanel sadly doesn't have a backup utility, so i've just been using phpmyadmin, and ftp for the directories.

    As of now, I backed up everything just to be safe.

    So, I think I understand most of it, but I do not understand what "/utility /structure" is/means, or how to do it.

    You're telling me to point the conf.php to the old db, that's the mysql database correct? But i'd still have to copy over the plugins and uploads folder manually?

    I think you have said that, but i'm just double checking.

    1. import old mysql db
    2. install vanilla 2.6
    3. change conf.php to match old mysql db
    4. go to the forum directory and upload the "uploads" and maybe "plugins" folders
    5. run /utility /structure (although i don't know how to do this yet)

    I think this should be about right. I'm always better with hands on work, which is how i got it to work last time, but I figured i'd be more cautious since i'm upgrading from an old version. Thanks again!

  • R_JR_J Admin

    Sounds already good.
    /utility/structure means visiting yourforum.com/index.php?p=/utility/structure

    Keep a copy of your .htaccess file. The current one doesn't work with all servers and you might need the old one.

  • Thanks R_J! From what i'm understanding, it just configures the new setup to the old db? That makes sense.

    How will i know if the htaccess isn't working properly? will the forum just not function at all? Either way, I have my old one here, backed up.

    Thanks again for the help.

  • R_JR_J Admin
    edited June 2018

    @StaticCory said:
    I think this should be about right. I'm always better with hands on work

    Most important thing is to have a backup. Just start and ask if you get stuck

  • Alright, so i've hit a roadblock. I've been messing around with a few things, trying to figure it out, but with no luck.

    Because I needed a database to install vanilla, I just made a random one for now.
    I got 2.6 set up properly, completely fresh install. (wouldn't work unless I used the old htaccess file)

    I uploaded my old database, which seemed to work fine.

    I opened conf/config.php, and I edited the database host/username to match my old database.

    I then proceeded to navigate to this "index.php?p=/utility/structure", but i am hit with this message:

    "Something has gone wrong.

    We've run into a problem and are unable to handle this request right now.
    Please check back in a little while."

    I tried messing around with it a bit, tried uploading the old .htaccess file again, in case that was messed up during the install, but it didn't do anything. I also deleted/reinstalled 2.6 multiple times to troubleshoot. It's probably something very simple that i'm missing, hopefully you guys can help.

  • Try clearing the files from the cache folder.

    If that doesn't work, please search 'Something has gone wrong' on here to find out how to turn on debug.

    This will give you a detailed error message.

  • edited June 2018

    There's an error log located in my file manager, and this is what's inside:

    PHP Fatal error: Table '************.GDN_User' doesn't exist in /home/*******/public_html/forum/library/database/class.database.php on line 421

    Just to make sure I did this right, I wasn't supposed to upload anything to the file manager, except the "uploads" folder, and "plugins" if i wanted to, correct? Everything else is saved in the old sql database?

    I'll definitely try and debug it, thanks.

    Edit:

    Something came to mind, so I decided to look into it. I checked my old db (as my old server is still active) and compared it to the db that I copied over to the new host. and for some reason the db that I copied over is missing everything from "GDN_Session" down, it's in alphabetical order, so it's missing quite a few, including GDN_User, which seems to be having the issue. Is there a reason why the export didn't work properly? I had to use compression, because my new host only allows 50mb, and it's larger than that, would that make a difference? Thanks!

  • R_JR_J Admin

    Exporting/importing large dbs can fail based on timeouts if you do this with a web frontend. If you have shell access, you should better use mysqldump and the command line to import the dump

  • Start with the basic Vanilla DB from a clean install, and make sure you know the path to your mySQL dump.

    DROP the tables from the clean install DB.

    Use command line to access mySQL

    Change to the clean Vanilla table, with the command USE

    Use SOURCE command

    SOURCE Pathto://dbDump.sql

  • Honestly, I don't know how to do any of that, and it'll probably end badly. I noticed that I can export individual tables, so is it possible for me to just export them from the old db (via phpmyadmin) and then import them into the new db (via phpmyadmin) and then run /utility/structure? If not, i'll try to do the command line method, thanks again!

  • Was going to edit, but I guess you can't edit after a certain period of time, so sorry for the double post, but i'm just trying not to waste your time.

    I ended up using MySQL Workbench, and exported the dump from my old host, to my PC. I then imported the dump to the new host via SSH (Workbench again). Once this is done, i'll go through the process again, hopefully this time it'll go smoothly.

  • edited June 2018

    Well, It's been a long, long day. And sadly, still no luck.

    I managed to import the database, after trying 3 different programs. Navicat finally worked for me. So the old database is currently on my server, attached to two different databases, for testing purposes.

    First, I tried the original method. I created a brand new db, and imported the old database into it. I then installed 2.6, and changed the conf.php details, to match this database, and proceeded to run /utility/structure. i'm then hit with the "Something has gone wrong" message.

    Secondly, I created another db, installed 2.6, removed all of the tables from this db, and imported my old db into it. I then ran /utility/structure, and i was hit with the same message, "Something has gone wrong".

    I guess i'm going to have to look into debug mode, to see what the problem is, and hopefully something turns up from that. If you have any other suggestions, that would be great, thanks.

    Edit:

    That went quicker than I thought. I set conf.php to debug mode, and visited the url, and this is what came up:

    The error occurred on or near: /home/******/public_html/forum/applications/dashboard/models/class.usermodel.php

    1747: // Replace permissions with those of the ConfirmEmailRole

    1748: $confirmEmailRoleID = RoleModel::getDefaultRoles(RoleModel::TYPE_UNCONFIRMED);

    1749:

    1750: if (!is_array($confirmEmailRoleID) || count($confirmEmailRoleID) == 0) {

    1751: throw new Exception(sprintf(t('No role configured with a type of "%s".'), RoleModel::TYPE_UNCONFIRMED), 400);

    1752: }

    1753:

    1754: $roleModel = new RoleModel();

    1755: $permissionsModel = new Vanilla\Permissions();

    Backtrace:

    [/home/******/public_html/forum/library/core/class.session.php:440] UserModel->getSession();

    [/home/******/public_html/forum/library/core/class.auth.php:59] Gdn_Session->start();

    [/home/******/public_html/forum/bootstrap.php:346] Gdn_Auth->startAuthenticator();

    [/home/******/public_html/forum/index.php:22] PHP::require_once();

    Any idea what it means?

  • Just decided to update this thread, since the official resolution ended up spanning across multiple threads, and I figured i'd keep it all together.

    1. I exported my old db using Navicat (use whichever method you prefer)
    2. created a new mysql database on new server
    3. Imported the db onto my new server using navicat again
    4. created another mysql database
    5. installed a fresh copy of 2.6
    6. dropped GDN_Permission and GDN_Role using phpmyadmin, from my old db
    7. grabbed GDN_Permission and GDN_Role from the fresh 2.6 install, and imported them into my old db
    8. changed config.php in 2.6 to point towards my old db
    9. ran /utility/update and /utility/structure
    10. completed.
  • Hi @StaticCory and @whu606 and @R_J ,

    Cory's final summary description (post above this one from August 2018) regarding importing GDN Permission and Role, neglects to mention that (in the old database) Role is connected (relational database wise) to GDN User via the GDN UserRole table. In other words, there are multiple lines in UserRole for each role that the User is assigned to. And all of these lines in UserRole in the old database are using the OLD values of the RoleID numbers.

    Thus, just importing GDN Role and Permission from the clean installed new database, does not address the wrong / unmatching values now present in the original old UserRole table.

    Is there a php or SQL script somewhere that will handle this conversion of the GDN UserRole table? Such a script MUST have been used on one of the previous version upgrades. Where it probably also rewrote the GDN Permission and Role tables.

    I did run the utility update and structure URLs several times each. They did not touch my UserRole table.

    Regards,

    William Croft, OpenBCI forum

  • Perhaps answering my own question,

    2.1.8p2 GDN_Role table:
    
    
    INSERT INTO `GDN_Role` (`RoleID`, `Name`, `Description`, `Type`, `Sort`, `Deletable`, `CanSession`, `PersonalInfo`) VALUES
    (1, 'GUESTS', '', 'guest', 1, 1, 1, 0),
    (2, 'REGISTERED', '', NULL, 2, 1, 1, 0),
    (3, 'REGISTERED_COPPA', '', NULL, 3, 1, 1, 0),
    (4, 'GLOBAL_MODERATORS', '', NULL, 4, 1, 1, 0),
    (5, 'ADMINISTRATORS', '', NULL, 5, 1, 1, 0),
    (6, 'BOTS', '', NULL, 6, 1, 1, 0),
    (7, 'NEWLY_REGISTERED', '', NULL, 7, 1, 1, 0);
    
    
    --
    
    
    2.8.4 GDN_Role:
    
    
    INSERT INTO `GDN_Role` (`RoleID`, `Name`, `Description`, `Type`, `Sort`, `Deletable`, `CanSession`, `PersonalInfo`) VALUES
    (2, 'Guest', 'Guest...', 'guest', 1, 0, 0, 0),
    (3, 'Unconfirmed', 'Unconf...', 'unconfirmed', 2, 0, 1, 0),
    (4, 'Applicant', 'App...', 'applicant', 3, 0, 1, 0),
    (8, 'Member', 'Member...', 'member', 4, 1, 1, 0),
    (16, 'Administrator', 'Admin...', 'administrator', 6, 1, 1, 0),
    (32, 'Moderator', 'Moderator...', 'moderator', 5, 1, 1, 0);
    
    
    --
    
    
    Conversion search / replace steps for GDN_UserRole,
    
    
    Delete lines with RoleID == 1, 3, 6, 7
    Replace RoleID 2 with 8
    Replace RoleID 4 with 32
    Replace RoleID 5 with 16
    
    
    
  • R_JR_J Admin

    Don't forget to make a backup before working with your database:

    DELETE FROM GDN_UserRole
    WHERE RoleID in (1,3,6,7);
    
    UPDATE GDN_UserRole
    SET RoleID = 8
    WHERE RoleID = 2;
    
    
    UPDATE GDN_UserRole
    SET RoleID = 32
    WHERE RoleID = 4;
    
    
    UPDATE GDN_UserRole
    SET RoleID = 16
    WHERE RoleID = 5;
    
Sign In or Register to comment.