Showing posts with label Upgrade. Show all posts
Showing posts with label Upgrade. Show all posts
Tuesday, February 20, 2018

Upgrade ownCloud From Packages


The best method for keeping ownCloud current on Linux servers is by configuring your system to use ownCloud’s Open Build Service repository. Then stay current by using your Linux package manager to install fresh ownCloud packages. After installing upgraded packages you must run a few more steps to complete the upgrade. These are the basic steps to upgrading ownCloud:

Make sure that you don’t skip a major release when upgrading via repositories. For example you can’t upgrade from 8.1.x to 9.0.x directly as you would skip the 8.2.x major release. See Upgrading Across Skipped Releases for more information.

-Disable all third-party apps.
-Make a fresh backup.
-Upgrade your ownCloud packages.
-Run occ upgrade (Optionally disable the Migration Test which might take a long time on large installations).
-Apply strong permissions to your ownCloud directories.
-Take your ownCloud server out of maintenance mode.
-Re-enable third-party apps.

When upgrading from oC 9.0 to 9.1 with existing Calendars or Addressbooks please have a look at the 9.0 release notes for important information about the needed migration steps during that upgrade.
Upgrade Tips

Upgrading ownCloud from our Open Build Service repository is just like any normal Linux upgrade. For example, on Debian or Ubuntu Linux this is the standard system upgrade command:

apt-get update && apt-get upgrade

Or you can upgrade just ownCloud with this command:

apt-get update && apt-get install owncloud

On Fedora, CentOS, and Red Hat Linux use yum to see all available updates:

yum check-update

You can apply all available updates with this command:

yum update

Or update only ownCloud:

yum update owncloud

Your Linux package manager only downloads the current ownCloud packages. Then your ownCloud server is immediately put into maintenance mode. You may not see this until you refresh your ownCloud page.

Then use occ to complete the upgrade. You must run occ as your HTTP user. This example is for Debian/Ubuntu:

sudo -u www-data php occ upgrade

This example is for CentOS/RHEL/Fedora:

sudo -u apache php occ upgrade

Optionally disable the Migration Test which might take a long time on large installations.

See Using the occ Command to learn more.
Setting Strong Directory Permissions

After upgrading, verify that your ownCloud directory permissions are set according to Setting Strong Directory Permissions.
Upgrading Across Skipped Releases

It is best to update your ownCloud installation with every new point release (e.g. 8.1.10), and to never skip any major release (e.g. don’t skip 8.2.x between 8.1.x and 9.0.x). If you have skipped any major release you can bring your ownCloud current with these steps:

-Add the repository of your current version (e.g. 8.1.x)
-Upgrade your current version to the latest point release (e.g. 8.1.10) via your package manager
-Run the occ upgrade routine (see Upgrade Quickstart above)
-Add the repository of the next major release (e.g. 8.2.x)
-Upgrade your current version to the next major release (e.g. 8.2.8) via your package manager
-Run the occ upgrade routine (see Upgrade Quickstart above)
-Repeat from step 4 until you reach the last available major release (e.g. 9.1.x)

You’ll find repositories of previous ownCloud major releases in the ownCloud Server Changelog.

Upgrading PostgreSQL Version on Ubuntu Server


When you need to upgrade the PostgreSQL version on Ubuntu, the process is pretty straightforward. This works for upgrading any version from Postgres 9.1, 9.2, 9.3, 9.4, 9.5, and 9.6.

We're going to be upgrading PostgreSQL server on Ubuntu in this guide. It doesn't matter which version you're upgrading from or to. You can do this with Postgres 9.1, 9.2, 9.3, 9.4, 9.5, and 9.6 or whatever is the most recent version. In this example, I'm upgrading Postgres 9.3 to Postgres 9.5 but all you have to do is replace the version numbers in the commands below to match which old version you're using and the new version you're upgrading to.

This only takes a couple minutes if you have a small database, so let's get started!

1. Install the latest version of Postgres
If you're using the default version available on Ubuntu, you can just upgrade to the latest postgres by running the following:

sudo apt-get upgrade

Otherwise if you want to upgrade to the very latest Postgres version, you can follow the instructions on their website here: https://www.postgresql.org/download/linux/ubuntu/

To find the installed versions that you currently have on your machine, you can run the following:

$ dpkg --get-selections | grep postgres
postgresql                  install
postgresql-9.3                  install
postgresql-9.6                  install
postgresql-client-9.3               install
postgresql-client-9.6               install
postgresql-client-common            install
postgresql-common               install
postgresql-contrib              install
postgresql-contrib-9.3              install
postgresql-contrib-9.6              install

You can also list the clusters that are on your machine by running

$ pg_lsclusters
Ver Cluster Port Status Owner    Data directory               Log file
9.3 main    5433 down   postgres /var/lib/postgresql/9.3/main /var/log/postgresql/postgresql-9.3-main.log
9.6 main    5432 online postgres /var/lib/postgresql/9.6/main /var/log/postgresql/postgresql-9.6-main.log

2. Stop Postgres before we make any changes
First thing's first, we need to stop any services using postgres so we can safely migrate our database.

sudo service postgresql stop

3. Rename the new Postgres version's default cluster
When Postgres packages install, they create a default cluster for you to use. We need to rename the new postgres cluster so that when we upgrade the old cluster the names won't conflict.

sudo pg_renamecluster 9.6 main main_pristine

4. Upgrade the old cluster to the latest version
Just replace the version (9.3) here with the old version of Postgres that you're currently using.

sudo pg_upgradecluster 9.3 main

5. Make sure everything is working again
We can start Postgres back up again and this time it should be running the new postgres 9.6 cluster.

sudo service postgresql start

You should also see that the old cluster is down and the new version of Postgres is up:

$ pg_lsclusters
Ver Cluster Port Status Owner    Data directory               Log file
9.3 main    5433 down   postgres /var/lib/postgresql/9.3/main /var/log/postgresql/postgresql-9.3-main.log
9.6 main    5432 online postgres /var/lib/postgresql/9.6/main /var/log/postgresql/postgresql-9.6-main.log

6. Drop the old cluster
Optionally, you can drop the old 9.3 cluster once you've verified the new one works and you don't need the old cluster anymore.

sudo pg_dropcluster 9.3 main

How to Upgrade MongoDB to Latest Stable Version


As usual with any software, old versions of MongoDB accumulate a number of security issues that if not addressed properly, could leave your data unprotected from attackers.

In order to ensure the best security and support possible, the MongoDB developers recommend to always install the latest stable version of MongoDB, which is 3.4.1 as of Feb 2017.

This guide explains:

-How to upgrade to MongoDB 3.4.1 via package manager
-How to upgrade to MongoDB 3.4.1 manually

Upgrading to MongoDB 3.4.1 via package manager
If you installed MongoDB from the MongoDB apt, yum, dnf, or zypper repositories, you should upgrade to 3.4.1 using your package manager.
Upgrading MongoDB on Ubuntu and other Debian derivatives

Debian package management tools (i.e. dpkg and apt) ensure package consistency and authenticity by requiring that distributors sign packages with GPG keys. Issue the following command to import the MongoDB public GPG Key:

$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6

Create the /etc/apt/sources.list.d/mongodb-org-3.4.list file replacing ubuntu xenial with the codename appropriate for your version of Ubuntu or Debian:

$ echo "deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list

    Ubuntu 12.04: ubuntu precise
    Ubuntu 14.04: ubuntu trusty
    Ubuntu 16.04: ubuntu xenial
    Debian 7: debian wheezy
    Debian 8: debian jessie

Now issue the following command to reload the local package database and directly install the latest stable version of MongoDB:

$ sudo apt-get update
$ sudo apt-get install -y mongodb-org

Upgrading MongoDB on Amazon Linux, Red Hat Enterprise Linux, CentOS and Fedora
First of all, you need to create a /etc/yum.repos.d/mongodb-org-3.4.repo file so that yum knows where to find latest MongoDB packages. Please replace redhat/7 with the codename appropriate for your distribution and version as listed below:

[mongodb-org-3.4]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/7/mongodb-org/3.4/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.4.asc

    RHEL 5 | CentOS 5 | Fedora Core 6: redhat/5
    RHEL 6 | CentOS 6 | Fedora 12–14: redhat/6
    RHEL 7 | CentOS 7 | Fedora 19–25: redhat/7
    Amazon Linux: amazon/2013.03

Now you can simply issue the following command to install the latest version of MongoDB:

$ sudo yum install -y mongodb-org

On recent Fedora releases (>22), you may need to use dnf instead:

$ sudo dnf install -y mongodb-org

Upgrading MongoDB on SUSE, SLES and OpenSUSE
First of all, you will need to import the MongoDB public GPG Key:

$ sudo rpm --import https://www.mongodb.org/static/pgp/server-3.4.asc

Then add the MongoDB repository origin using zypper. Feel free to replace the version number 12 to match yours:

$ sudo zypper addrepo — gpgcheck “https://repo.mongodb.org/zypper/suse/12/mongodb-org/3.4/x86_64/" mongodb

Now you can simply issue the following command to install the latest version of MongoDB:

$ sudo zypper -n install mongodb-org

Upgrading MongoDB manually
If you have not installed MongoDB using a package manager, you can manually download the MongoDB binaries from the MongoDB Download Center.

For example, to download the latest release through the shell, issue the following:

$ curl -O https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.4.1.tgz

Then extract the files from the downloaded archive. From a system shell, you can extract through the tar command:

$ tar -zxvf mongodb-linux-x86_64-3.4.1.tgz

Now copy the extracted folder to the location from which you wish MongoDB to run:

$ mkdir -p mongodb
$ cp -R -n mongodb-linux-x86_64-3.4.1/ mongodb

The MongoDB binaries are in the bin/ directory of the archive. To ensure that the binaries are in your PATH, you can modify your PATH.

For example, you can add the following line to your shell’s rc file (e.g. ~/.bashrc):

export PATH=<mongodb-install-directory>/bin:$PATH

Remember to replace <mongodb-install-directory> with the path to the extracted MongoDB archive.

Now reload mongod and that’s all!

$ sudo service mongodb reload

How to upgrade to PHP 7 on CentOS 7 Linux Server


The objective is to install or replace existing PHP 5 with PHP 7 on CentOS 7 Linux server. As you will see, this procedure is fairly simple when using Remi Repository.

Requirements
Privileged access to your CentOS Linux system either directly as root user or via sudo command is required.

Difficulty
EASY

Conventions
# - requires given command to be executed with root privileges either directly as a root user or by use of sudo command
$ - given command to be executed as a regular non-privileged user

Instructions
The following guide will either upgrade your current PHP 5 to PHP 7 or will install new PHP 7 on your CentOS system. Check your current PHP version ( if applicable ):

# php --version
PHP 5.4.16 (cli) (built: Nov  6 2016 00:29:02)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies

Download Remi and EPEL Repository packages
First, download Remi and EPEL Repository packages:

$ wget -q http://rpms.remirepo.net/enterprise/remi-release-7.rpm
$ wget -q https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

Enable Remi and EPEL Repository
Install both previously downloaded packages and enable Remi PHP 7 repo:

# rpm -Uvh remi-release-7.rpm epel-release-latest-7.noarch.rpm
FOR PHP 7.0 EXECUTE:
# yum-config-manager --enable remi-php70
FOR PHP 7.1 EXECUTE:
# yum-config-manager --enable remi-php71

Current latest PHP version from Remi repository is 7.1. Amend the above command for any other subsequent PHP releases.

Install or Upgrade to PHP 7
Whether you already have PHP 5 installed on your system or you are performing a new PHP 7 installation, the below command will cater for both:

# yum install php

Alternatively, upgrade entire system with yum update command:

# yum update

Check your current PHP version

# php --version
PHP 7.1.0 (cli) (built: Dec  1 2016 08:13:15) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.1.0-dev, Copyright (c) 1998-2016 Zend Technologies