
Before upgrading a running server to the latest version of Newscoop, it is strongly recommended that you back up your publication database, templates, images, file attachments and configuration files. First, log in to the administration interface (see the Getting started chapter in this manual for details). Click on Actions in the main navigation menu. At the lower end of this menu, click Backup/Restore.
On the Backup/Restore page which opens, click the Make new backup link next to the green plus sign icon.
A dialog box will ask you if you are sure you want to make the backup.
Click the OK button, and a pop-up window will display the progress of the backup. Once the window reports Backup saved to file: you can click the Close link to return to the Newscoop administration interface.
On the Backup/Restore page, the backup you just made should be listed, together with any previous backups.
Click on the disk icon in the Download column to save the gzipped backup tarball (with the .tar.gz file extension) from your Newscoop server to your desktop computer.
To restore a previous backup into a running Newscoop system, click the Upload backup file link, and then select the backup from your desktop computer's file system.
Newscoop includes two scripts that can be used for backup and restore on the command line of your server. They are found in the bin/ subdirectory of your Newscoop installation, such as /var/www/newscoop/bin/ or a similar location. Because these scripts require access to your Newscoop configuration files, they must be run as the root user (with sudo on Ubuntu).
You can create backup archives using the following command:
$ sudo /path/to/newscoop/bin/newscoop-backup [--silent] [--default-dir] [--help]
The optional arguments to the newscoop-backup command are:
The output of the command should resemble the following example:
$ sudo /var/www/newscoop/bin/newscoop-backup --default-dir Newscoop Backup Utility ----------------------- Backup script version: 3.5.3 "Bea" Backing up newscoop * Backing up the database...done. * Backing up the templates...done. * Backing up images...done. * Backing up file attachments...done. * Backing up configuration files...done. * Creating tarball...done. * Cleaning up...done. Backup saved to file: /var/www/newscoop/backup/backup-newscoop-2011-06-22-16-21-12.tar.gz
The archive file name is backup-newscoop-[date_time].tar.gz and this tarball contains the whole Newscoop instance: the database, templates, images, attached files and configuration files. You can find the size of the backup archive with the ls -lh command, for example:
$ ls -lh /var/www/newscoop/backup total 26M -rw-r--r-- 1 root root 26M 2011-06-22 16:21 backup-newscoop-2011-06-22-16-21-12.tar.gz
To restore from a specific backup archive, use the command:
$ sudo newscoop-restore -b backup_file [-t destination_database_name] [-e] [-c charset] [-s] [-l] [-f] [-h]
The -b backup_file argument is used to provide the full or relative path to the tarball previously created by the newscoop-backup script. For example:
$ sudo /var/www/newscoop/bin/newscoop-restore -b /var/www/newscoop/backup/backup-newscoop-2011-06-22-16-21-12.tar.gz Newscoop Restore Utility ------------------------ * Initializing... * Temp directory: backup-newscoop-2011-06-22-16-21-12 * Initialization done. * Extracting files into temp directory...done. * Backup database name is 'newscoop'. * Destination database name (to be replaced) is 'newscoop'. All files in the following directories will be deleted. (The backup files will be copied to these locations) /var/www/newscoop/templates /var/www/newscoop/images /var/www/newscoop/files /var/www/newscoop/templates_cache Are you sure you want to continue? (y/N) y * Removing files in /var/www/newscoop/templates...done. * Removing files in /var/www/newscoop/images...done. * Removing files in /var/www/newscoop/files...done. * Removing files in /var/www/newscoop/templates_cache...done. * Restoring templates...done. * Restoring images...done. * Restoring file attachments...done. done. * Upgrading templates...done. * Restoring the database newscoop...done. * Upgrading (if necessary)... * Upgrading the database from version 3.5.x...done. * Updating plugins (if necessary)... done. * Cleaning up...done. IMPORTANT! You must restart the apache server for the changes to take effect!
The optional arguments to the newscoop-restore script are:
The newscoop-restore script will replace all existing data with the contents of the backup archive. You must run the script from a directory that you have write access to, because this script needs to create a temporary directory. Note that your backup database and files will automatically be upgraded if they are older than the currently installed version of Newscoop.
Finally, restart Apache as suggested by the message from the newscoop-restore script.
$ sudo /etc/init.d/apache2 restart * Restarting web server apache2 ... waiting [ OK ]
With multiple installations of Newscoop on a single server, you must run the newscoop-restore script from the installation where you want to restore the matching data. For example, you may have installed Newscoop in two locations, /var/www/newscoop1 and /var/www/newscoop2. To restore the data for the newscoop1 installation, you must run /var/www/newscoop1/bin/newscoop-restore rather than the /var/www/newscoop2/bin/newscoop-restore script.
After you have completed the backup successfully, update your Newscoop installation using either the automated or manual methods described in the following chapters. If using the manual installation method for an upgrade, the existing files in the Apache DocumentRoot folder (such as /var/www/newscoop/) should not be removed, unless you wish to perform a clean install with new database content.
When the new files are copied over the existing Newscoop installation, your publications will automatically be taken offline, and a maintenance message will be displayed to your readers. Next, check the .htaccess file in the DocumentRoot folder, particularly if you have made custom modifications to this file in a previous installation. When upgrading from Newscoop 3.5 to 3.6, you will need to replace the line:
RewriteCond %{REQUEST_URI} !/+templates
with the line:
RewriteCond %{REQUEST_URI} !/+themes
due to the renaming of the templates folder to themes. In version 3.5.3 or later, you should check that the line:
RewriteCond %{REQUEST_URI} !(/+plugins/[^/]*)?/+javascript
has been replaced by:
RewriteCond %{REQUEST_URI} !(/+plugins/[^/]*)?/+js
again, due to a folder name change from javascript to js in this version.
Then you should run the upgrade.php script in your web browser, for example:
http://www.example.com/upgrade.php
Once the upgrade is complete, your publications will automatically be put back online.