Table des matières

Sujet précédent

1.2. Installation de OpenPLM serveur version de développement

Sujet suivant

2. settings — Settings

Cette page

Autres langues

1.3. How to upgrade an installation of OpenPLM

Warning

Before upgrading your installation, read the whole document and be sure to have reliable backups.

1.3.1. Stopping the server

  • service apache2 stop
  • service celeryd stop

1.3.2. Backups

1.3.2.1. Database

See your database documentation:

1.3.2.2. Code

Backups are mostly useless if you do not have the code that was running.

Copy the content of /path/to/openPLM/ (directory containing the settings.py file). You should also copy your apache configuration and your celery files (/etc/init.d/celetyd and /etc/default/celeryd).

1.3.2.3. Files

Copy /var/openPLM/docs.

1.3.2.4. Thumbnails and 3D files

Copy /path/to/openPLM/media/thumbnails and /path/to/openPLM/media/public.

If document3D application is installed, copy /path/to/openPLM/media/3D.

1.3.2.5. Search indexes

You can also copy /var/openPLM/xapian_index, it is easy to rebuild the index but it can take a few minutes.

1.3.2.6. Restoring a backup

  • Stop apache and celery
  • Restore all files
  • Restore the database
  • Restore the code
  • Restore search indexes or rebuild them

1.3.3. Updating the code

1.3.3.1. Development version (svn)

  1. Backup your files, code, settings.py, thumbnails...
  2. Check your own modification: svn up and svn diff
  3. Run svn up
  4. Restore your own settings (svn should have gracefully updated the settings.py file)

1.3.3.2. Stable version (tarball)

Here, openPLM is installed in /var/django.

  1. Backup your files, code, settings.py, thumbnails...

  2. Extract the tarball in a temporary directory. For example: tar xzf openplm-XYZ.tgz -C . /tmp

  3. Copy the files: cp -rp /tmp/openplm/openPLM /var/django, /var/django is the directory containing your openPLM directory

  4. Restore your settings.py file:

    • cp /var/django/openPLM/settings.py /var/django/openPLM/settings.py.orig
    • cp backups/settings.py /var/django/openPLM
  5. Fix the python path in apache *.wsgi files: sed -in 's#\(/var/django/\)openPLM/trunk/#\1#' apache/*.wsgi

1.3.4. New settings

It is possible that a new version comes with new settings. Generally, new settings are optional and their default values do not changes the behavior of a previous installation. New settings may better fit your needs. You can easily determinate new settings:

  • development version:

    diff /path/to/backup/settings.py /path/to/settings.py (svn should have merged your settings and the original settings)

  • tarball:

    diff -u /var/django/openPLM/settings.py /var/django/openPLM/settings.py.orig

1.3.5. Migrating the database

One simple command:

  • ./manage.py migrate

1.3.6. Translations

Not required if you update using the tarball:

  1. make
  2. ./bin/translate_all.sh compile all

1.3.7. Search indexes

Not really required but some functionalities may run faster.

  1. ./manage.py rebuild_index
  2. chown www-data:www-data -R /var/openPLM

1.3.7.1. Determining if you should rebuild the index

Rebuilding search indexes can take several minutes depending on the number of indexed parts, documents and files. You can try to rebuild indexes and if it takes too much time you can safely restore your backed up indexes.

Version 1.2:

  • group attribute is indexed and it is now possible to query documents by their group (group=a_group_name). Previously, a query like a_group_name matched the right documents but group=a_group_name would returned an empty result set.
  • OpenPLM 1.2 tests if a search result is readable by the current user. If search indexes are not rebuilt, each search will hit the database and take a little more time.

1.3.8. File permissions

  • chown www-data:www-data -R /var/openPLM
  • chown www-data:www-data -R /var/django/openPLM/trunk/openPLM/media/thumbnails
  • chown www-data:www-data -R /var/django/openPLM/trunk/openPLM/media/public/thumbnails
  • chown www-data:www-data -R /var/django/openPLM/trunk/openPLM/media/3D if document3D is installed

1.3.9. Enabling new applications

A new version of OpenPLM often comes with new optional applications. You can enable them according to your needs.

1.3.10. Other actions

1.3.10.1. OpenPLM 1.2

You can load more optional lifecycles:

  • ./manage.py loaddata extra_lifecycles

1.3.11. Starting the server

service celeryd start

service apache2 start

Now you can test and complain if something does not work ;-)