Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+3 votes
332 views
in Q2A Core by
closed by

I have installed Q2A v1.8.4. And i made changes to some core files and SnowFlat theme's CSS file as per my requirement.

Everything working well.

Now one thing confusing me, what if there is new update available for Q2A and i want to update my installation?

I had not used any earlier versions of Q2A so i don't know how users updates their Q2A CMS. 

how to update Q2A step by step? 

What will change after i update? 

If anyone can provide tips to keep my changes as it is so it will be very helpful for me and everyone searching for this query. 

Bcoz there is lot's of energy & hours spend behind to start QA site. And no one want to mess up everything by just one mistake. 

Q2A version: 1.8.4
closed with the note: Solved :)
by
What kind of things have you changed in the core files?
by
Lots of changes was made in CSS file to change look and feel of site, and if I talk about changes in CORE files then it includes Footer Attribution replacement, some words replacement in language file.

2 Answers

+3 votes
by
selected by
 
Best answer

For the general case, you extract the zip download and copy/upload the files to your hosting.

If you have modified core files it’s more complicated. I’ll say first up that you almost never need to modify core files, pretty much anything you want to change can be done with a plugin. Will get to that later.

teddydoors’ answer covers updating. One extra idea: add a comment that you can easily search, e.g. // core mod: [description]

Then put the new code in another folder, search through your old code for your mods and copy them over to the new code. Then you can copy that back to your main install.

You can also look at exactly what files have changed in each release. On GitHub go to “releases” (right column), then there is a “Compare” dropdown. So for v1.8.5 you can compare to v1.8.4 and you’ll get this page: https://github.com/q2a/question2answer/compare/v1.8.4...v1.8.5

Any files you haven’t modified you can copy straight over, the others you can look at what changed and do those changes yourself.

To answer your and Zeeshan’s specific changes. I don’t think splitting the CSS is a good strategy, because now you’re loading different files on different pages, instead of having one file that’s cached for all pages.

Changes like removing JS or the footer attribution can be done with layer plugins that override those same functions from the theme.

And you mentioned language files - those can also be customised separately too. See the last section of this page.

by
Thanks a lot @Scott, You are really good and you deserve the "Super Admin" Title. I really appreciate your hard work and dedication to the entire community.

Thank you @teddydoors, @AnsgarWiechers, @Zeeshan & @GATEOverflow to join this conversation & helping us.
by
@Gate Overflow, you can send HTML email with a function override plugin for qa_send_email.
Not sure exactly what you mean by filtering but you could create your own separate pages using a page plugin.
But yes you can’t override existing pages to show completely different content, only add things with widgets/layers.
by
Thank you Scott. Yes, I 'm overriding the qa_send_function but would have been better to have an option to use the same function with HTML option.

By filtering I mean users have an option
1. Not see questions with certain tags
2. Not see questions from certain users (block feature which is available in FB for example)

The above can be achieved by overriding the qa_db_posts_basic_selectspec function and adding an extra join condition on the appropriate filter we need. But this messes up the question count in the parent functions which calls this basic_selectspec and hence we need to modify the core -- not difficult though as it is just 2-3 lines. Still it will be good to have this filter feature implemented properly in Q2A.
by
+1
By the way HTML email is something I'm considering for a future release, it has been requested a few times.
+2 votes
by
There will be no automatic Update button, so in case Q2A 1.8.5 is released in the future, you will download its file (in ZIP format). You then unzip it and overwrite everything in your installation folder.

There are two files that will remain unaffected (so far as I know) is the qa-config.php and .htacess file.

Snowflat theme is a bundled theme so it will be overwritten too.

My suggestion is that you duplicate your modified Snowflat theme and rename it as some different name. Also change what's in metadata.json file, so it's easier to distinguish among themes.

For any changes in the core files, for example, you did change something in qa-include/app/format.php, then you duplicate the format.php file and rename it as format-backup.php.

In the future, the format.php file will be overwritten, but your format-backup.php file is still there.

Btw, always save a backup version locally in your notebook hard drive.
by
Just as a side note: also create a backup of your database before an update.
...