Upgrading

From StatusNet
Revision as of 15:03, 26 July 2012 by March (Talk | contribs)
Jump to: navigation, search

Contents

Warning

First off, upgrading from one version StatusNet, or any software, always has a risk of data loss.

Emblem-important-red.svg.png Make sure that you've made a working backup of any and all data before continuing.



The WordPress codex has a good guide on backing up a web app database, which are just as applicable to StatusNet.

The most important part of the backup is the database; assuming you are using MySQL the command below backs-up up a single database named "exampledbname"

 mysqldump --hex-blob --password="idunnowhat" exampledbname | gzip > backupname.sql.gz

You should also be sure to make a copy of the files on your site, especially your config.php and any images stored in the avatar, background, and file directories.

The Process

The current way to do an upgrade is first to download the software you want to upgrade to.

It's typically not a good idea to copy the new files into the same directory. This will typically result in some clashes with things that were moved or deleted. You should instead put the new code into a new directory and copy over your config.php and point things to run from this new directory, or rename the other directory to 'old-code' first or something.

You should stop any daemons that you may have running at this point, and if necessary stop people from being able to access your site during the upgrade.

Database

If updating to a new major release (such as from 0.8.2 to 0.9.1), you'll need to run the upgrade script to update your database:

  • From 0.7.x to 0.8.x run
     mysql -u<root user> -p<root password> <database>  < db/074to080.sql 
  • From 0.8.x to 0.9.x, the
     mysql -u<root user> -p<root password> <database> < db/08to09.sql 

If you're upgrading from 0.7 to 0.9, running both of those lines in succession should work.

Plugins

While it may not always be necessary, it can be a good idea, to run
 php scripts/checkschema.php 
from the installation directory.

This tells the plugins to create or update any additional database tables that they may require.

If you haven't configured otherwise, it should do this check when the site is visited, but doing it manually can help if there are any problems by informing you of them in a much more direct way.

Release Candidates, Betas, and Unofficial Releases

Typically these versions are meant for developers and our more technical and familiar users.

Upgrading to these versions is typically a very manual process, and there are often no scripts, and the scripts that are there are not well supported.

Typically the guidelines are "If you don't know what you're doing, don't upgrade to these versions".

Note for upgrading to 1.0 betas: Since the themes have changed, you will need to change the config table in the database - line where section=site and setting=theme - to "neo" or the site will display with no themes at all. There doesn't appear to be a theme selection UI at the moment, so you have to do this config in the database.

Config file

When upgrading my singleuser install from 0.9.7 to 1.0, I had to change this:

$config['singleuser']['enabled'] = true;
$config['singleuser']['nickname'] = 'augustl';

into this:

$config['site']['profile'] = 'singleuser';
$config['singleuser']['nickname'] = 'augustl';
Personal tools
Namespaces
Variants
Actions
Navigation
Status.net
Toolbox