<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.pixelrefraction.com/index.php?action=history&amp;feed=atom&amp;title=RefractSurvey_Upgrading</id>
	<title>RefractSurvey Upgrading - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.pixelrefraction.com/index.php?action=history&amp;feed=atom&amp;title=RefractSurvey_Upgrading"/>
	<link rel="alternate" type="text/html" href="https://wiki.pixelrefraction.com/index.php?title=RefractSurvey_Upgrading&amp;action=history"/>
	<updated>2026-09-16T17:34:54Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.0</generator>
	<entry>
		<id>https://wiki.pixelrefraction.com/index.php?title=RefractSurvey_Upgrading&amp;diff=190&amp;oldid=prev</id>
		<title>Nerdofepic: Created page with &quot;Upgrading RefractSurvey is two separate things: getting the new &#039;&#039;&#039;files&#039;&#039;&#039; onto your server, and letting the &#039;&#039;&#039;database&#039;&#039;&#039; catch up. This is a technical page &amp;mdash; if something here doesn&#039;t make sense, an upgrade is a good time to ask whoever manages your server.  == Step 1: Copy the new files over ==  Unzip the new release somewhere on the server, then from inside it, run:  &lt;pre&gt; sudo refractsurvey_server/upgrade.sh &lt;/pre&gt;  This copies the new application files over...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.pixelrefraction.com/index.php?title=RefractSurvey_Upgrading&amp;diff=190&amp;oldid=prev"/>
		<updated>2026-09-13T13:58:54Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;Upgrading RefractSurvey is two separate things: getting the new &amp;#039;&amp;#039;&amp;#039;files&amp;#039;&amp;#039;&amp;#039; onto your server, and letting the &amp;#039;&amp;#039;&amp;#039;database&amp;#039;&amp;#039;&amp;#039; catch up. This is a technical page — if something here doesn&amp;#039;t make sense, an upgrade is a good time to ask whoever manages your server.  == Step 1: Copy the new files over ==  Unzip the new release somewhere on the server, then from inside it, run:  &amp;lt;pre&amp;gt; sudo refractsurvey_server/upgrade.sh &amp;lt;/pre&amp;gt;  This copies the new application files over...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Upgrading RefractSurvey is two separate things: getting the new &amp;#039;&amp;#039;&amp;#039;files&amp;#039;&amp;#039;&amp;#039; onto your server, and letting the &amp;#039;&amp;#039;&amp;#039;database&amp;#039;&amp;#039;&amp;#039; catch up. This is a technical page &amp;amp;mdash; if something here doesn&amp;#039;t make sense, an upgrade is a good time to ask whoever manages your server.&lt;br /&gt;
&lt;br /&gt;
== Step 1: Copy the new files over ==&lt;br /&gt;
&lt;br /&gt;
Unzip the new release somewhere on the server, then from inside it, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo refractsurvey_server/upgrade.sh&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This copies the new application files over your existing live install. It&amp;#039;s non-destructive on purpose:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;config/&amp;lt;/code&amp;gt; (your database credentials and settings) is left completely untouched.&lt;br /&gt;
* &amp;lt;code&amp;gt;uploads/&amp;lt;/code&amp;gt; (your survey images) is left completely untouched.&lt;br /&gt;
* Nothing is ever deleted from the live install &amp;amp;mdash; files are only added or overwritten.&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s the entire file-copying step. You don&amp;#039;t need to stop Apache or take the site offline to run it.&lt;br /&gt;
&lt;br /&gt;
== Step 2: Let the database catch up ==&lt;br /&gt;
&lt;br /&gt;
You usually don&amp;#039;t have to do anything for this part. The next time an administrator logs in after an upgrade, if the new code needs a database change it doesn&amp;#039;t have yet, they&amp;#039;re automatically sent to a one-button &amp;#039;&amp;#039;&amp;#039;&amp;quot;Database Update&amp;quot;&amp;#039;&amp;#039;&amp;#039; page &amp;amp;mdash; click it, and the database is brought up to date on the spot. Everyone else just sees a brief &amp;quot;please wait&amp;quot; page until that happens.&lt;br /&gt;
&lt;br /&gt;
If you&amp;#039;d rather apply the database update immediately, right after copying files, instead of waiting for someone to log in, run this from inside the (now-upgraded) application root:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bash scripts/upgrade.sh&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is a separate, CLI-only script that does &amp;#039;&amp;#039;&amp;#039;only&amp;#039;&amp;#039;&amp;#039; the database part &amp;amp;mdash; it checks that &amp;lt;code&amp;gt;config/config.php&amp;lt;/code&amp;gt; exists, confirms the PHP CLI is available, and then applies any pending database migrations. It&amp;#039;s the command-line equivalent of clicking the &amp;quot;Database Update&amp;quot; button in a browser, which makes it a good fit for a deploy script that shouldn&amp;#039;t depend on a human visiting a web page. If there&amp;#039;s nothing pending, it prints that the database is already up to date and exits cleanly &amp;amp;mdash; safe to run even when you&amp;#039;re not sure whether an update is needed.&lt;br /&gt;
&lt;br /&gt;
== A note on permissions ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;config/config.php&amp;lt;/code&amp;gt; is deliberately locked down to be readable only by the web server&amp;#039;s own user and group. If you run &amp;lt;code&amp;gt;scripts/upgrade.sh&amp;lt;/code&amp;gt; as a different user, you may see a permission error reading that file. That&amp;#039;s expected and not a bug &amp;amp;mdash; run the command as the web server&amp;#039;s user (for example, with &amp;lt;code&amp;gt;sudo -u www-data bash scripts/upgrade.sh&amp;lt;/code&amp;gt;), or as a user in the same group.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[RefractSurvey_Getting_Started|Getting Started]]&lt;br /&gt;
* [[RefractSurvey_Automated_Server_Setup|Automated Server Setup]]&lt;br /&gt;
* [[RefractSurvey_Security_Notes|Security Notes]]&lt;br /&gt;
&lt;br /&gt;
[[Category:RefractSurvey]]&lt;/div&gt;</summary>
		<author><name>Nerdofepic</name></author>
	</entry>
</feed>