Jump to content

Upgrading from 5.1.9 to 5.2.7 - Tips and Tricks?


Recommended Posts

Hello everyone,


My mouth waters when I look at all the new 5.2.x features, I have been afraid to upgrade until now, I simply cannot wait any longer, so I am willing to take the risk this weekend!


My current version (which works wonderfully) is 5.1.9


Can anyone please share any problems, issues, gotchas that I should be aware of BEFORE I begin the upgrade process? WHMCS is critical to the running of my business so I need it to work properly as soon as possible.


Any hints, tips, advice before I begin?


Any information you can provide will be greatly appreciated to the highest level!





Link to comment
Share on other sites

ebmocwen, much care is taken to ensure that upgrades go as smoothly and safely as possible. While bad stuff can happen, we strive to make the upgrading process both easy, safe, and reliable, even from several major versions back. I know this because I spent quite a bit of time these past few weeks both further solidifying and testing the installation / upgrade procedure in preparation for the 5.3 release.


Being a WHMCS developer and user myself, and having upgraded from 5.1.9 and 5.2.x numerous times, here is what I would do if I were you.


Disclaimer: This is *not* an official guide. This is educational material only and is provided "AS IS", without warranty of any kind. Use at your own risk.


0. *Optional*: Install the Maintenance Mode Plus Addon and put your site into Maintenance Mode. This is especially important if you believe users could possibly place orders or otherwise using the site during this process, which will take somewhere between 5 and 45 minutes, depending on your comfort level, skills, upload speeds, and level of luck.


1. *Important*: Backup your database. From the commandline:

$ mysqldump -u <whmcs_db_user> -p <whmcs_db_name> > whmcs-20130928.sql


2. Create a new database named "whmcs_v52" for 5.2. If upgrading to 5.3, you should name it "whmcs_v53".


Note: You can find out what your WHMCS database username is by looking in configuration.php.


$ mysql -u root -p
mysql> CREATE DATABASE whmcs_v52;
mysql> GRANT ALL ON whmcs_v52 TO <whmcs_db_user>@localhost;


3. Import in the backup'd data:

$ mysql -u <your_whmcs_db_user> -p whmcs_v52 < whmcs-20130928.sql


4. *Important*: Copy your entire whmcs folder to a new directory, with the complete version at the end.

cp -avf whmcs whmcs-v5.1.9


6. Go into your original whmcs folder and edit configuration.php. Change $db_name's value to "whmcs_v52".


7. Test your site really quickly and make sure it still works fine.


8. Follow the WHMCS upgrade instructions. (Basically, replace your 5.1.x files with the new version's, and then go to http://www.yourdomain.com/whmcs/install/install.php). When finished upgrading, remove the whmcs/install/ directory.


9. Don't forget to update your templates, if you have done custom work! You can find the changes in the Release Notes of the version you are upgrading to.


10. Be sure to delete all of the files in your templates_c directory. This will ensure that any template changes will be ready when you turn the site back on.

$ rm -rf templates_c/*


11. If everything goes as planned, your WHMCS test database has now been successfully upgraded to the latest version. Now, you should test your site to your heart's content and make sure everything is working as suspected.


11b. In the off chance that you do find something wrong, consider opening up a new bug report in these forums.


12. -On Success- Happy with how the upgrade went? That's great. Just one more step left: Delete your install/ directory:


$ rm -r install/


Remember to (eventually) remove your old WHMCS directory and database, once you are really for sure there are no problems with the upgrade. Consider password-protecting it, or moving it outside of the web root, in the interim.


13. -On Failure- Sorry things didn't work out as well as we'd all like. Please consider filing a bug report, but first, here's how to revert your changes, fast:


13a. Rename the whmcs directory to "whmcs-vVERSION"

$ mv whmcs whmcs-v5.2.7


13b. Rename the original whmcs directory whmcs again:

$ mv whmcs-v5.1.9 whmcs


Assuming that you completed this guide successfully, the above should absolutely have you reverted back to your initial pre-update state.


14. -On Success or Failure- Be sure to take your site off of Maintenance mode, if you had previously done so (Step 0).


Disclaimer: This is *not* an official guide. This is educational material only and is provided "AS IS", without warranty of any kind. Use at your own risk.

Edited by WHMCS TedX
Delete the installer
Link to comment
Share on other sites

An excellent guide, thank you Ted!


Can anyone confirm that it is no longer required to do the following prior to the upgrade:


UPDATE tblconfiguration SET value='5.1.5' WHERE setting='Version';


I located this information in the following thread: http://forum.whmcs.com/showthread.php?73707-whmcs-admin-login-failed-after-upgrade


Can anyone confirm that this 'fix' is no longer relevant prior to the upgrade from 5.1.9 to 5.2.7?


Thank you in advance!

Link to comment
Share on other sites

I am pleased to say, my upgrade to 5.2.7 from 5.1.9 was a resounding success!!!


Using the guide provided by WHMCS Ted, I covered my back and begun the upgrade process with the confidence that I could get back to pre-upgrade conditions should things not go entirely to plan.


I did NOT perform the database 'fix' prior to the upgrade - or even at all. I followed the upgrade instructions exactly, the preparation took considerably more time than the upgrade process itself, which was less than 5 minutes.


The most time consuming part was carrying my custom changes from the 5.1.x 'Default' template into the 5.2.7 'Default' template, I found that i'd changed around 10 files in all.


After the upgrade, things did initially look a little strange when viewing tickets as admin - until I cleared the templates cache 'template_c' folder then everything was fine. Am loving the tweaks and new features!

Link to comment
Share on other sites

Thank you for reminding me about clearing the templates_c directory; I have updated the guide.


The major goal of my upgrade process was a 1) speedy and 2) near fool-proof reversion in case crap happened. We've all done deployments that headed south in some unexpected way; it's super nice to have a 30 second fallback (just move two folders) than having to cavalierly hack one's way out of an outage, while racing against the clock and potential lost revenue.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated