Use your data to test last version

From Dolibarr ERP CRM Wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.


The testers among you will certainly want to test the latest updates at some point in order to check the status of certain bugs or commit to a new version.

Duplication of a Dolibarr instance

In order to use your data with peace of mind, here is a procedure to follow to avoid losses ...

Warning! This documentation is based on examples taken from a Dolibarr installation with the following configuration

  • Linux Debian Etch
  • MySQL 4.1
  • Apache2

If you use another type of machine, please make the usual modifications.

Copy

As your data is of great value, it would be a shame to lose it. In order to test an update, why not copy your data elsewhere?

Directory

Since, most likely, your entire Dolibarr installation resides in a single directory, copying will be easy.

cp -ra /var/www/dolibarr /var/www/dolibarrtest

This command will copy your Dolibarr directory (supposed to be in /var/www/dolibarr here) in a second dolibarrtest directory on which you will run your tests. The -ra means recursive and retains files permission. This last option will allow you not to worry about file rights issues after copying.

Database

  • Backup your database:
mysqldump -u utilisateur -p --result-file=dolibarr.date.sql database
  • Edit the resulting file and modify the line USE database; at the start of the file to replace it with a new database name, that of the test database, for example USER test_database; in this case.
  • Create the new database if you haven't already. If the database exists, drop it and recreate it, in order to get in the end only the data actually extracted from your current database.
mysqladmin -u user -p drop test_database
mysqladmin -u user -p create test_database

Your permissions may not allow you to drop/create a database. In this case, see your MySQL documentation regarding permissions.

  • Importez les données de votre base de départ dans votre nouvelle base
mysql -u user -p test_database < dolibarr.date.sql

Apache Virtual Hosts

If you are using virtual hosts in Apache, you will need to create a new one for your test installation. For example, if you had something like this in a file named /etc/apache2/sites-available/dolibarr:

 <VirtualHost *:80>
  ServerName dolibarr.mydomain.net
  ServerAdmin webmaster@mydomain.net
  DocumentRoot /var/www/dolibarr/htdocs
  DirectoryIndex index.php
  ErrorLog  /var/log/apache2/dolibarr-error.log
  CustomLog /var/log/apache2/dolibarr-access.log combined
 </VirtualHost>

... it will now be necessary to make a copy in, for example, /etc/apache2/sites-available/dolibarrtest:

 <VirtualHost *:80>
  ServerName dolibarrtest.mydomain.net
  ServerAdmin webmaster@mydomain.net
  DocumentRoot /var/www/dolibarrtest/htdocs
  DirectoryIndex index.php
  ErrorLog  /var/log/apache2/dolibarrtest-error.log
  CustomLog /var/log/apache2/dolibarrtest-access.log combined
 </VirtualHost>

Be careful, this is not enough to make this host available, it will also be necessary:

  • set up the specified subdomain, including redirection rules on the machine that serves as DNS for your domain
  • create a symbolic link from /etc/apache2/sites-enabled/dolibarrtest vers /etc/apache2/sites-available/dolibarrtest

ln -s /etc/apache2/sites-enabled/dolibarrtest /etc/apache2/sites-available/dolibarrtest

  • reload the Apache2 config

/etc/init.d/apache2 reload

Configuration file

Finally, the configuration file /var/www/dolibarrtest/htdocs/conf/conf.php must absolutely be modified. As long as it is not modified, your dolibarrtest installation will indeed always connect to your real database, not the test one! Edit the configuration file and change the name of the database to connect to. Like in the examples above, rename database in test_database. Also rename the directories your configuration refers to. The /var/www/dolibarr become /var/www/dolibarrtest.

Checks

If you have completed the preparatory steps, you should now be able to load your new portal in your browser and verify that it is indeed a separate portal. How shall we do it?

DB modification

  • Modify a small information (for example modify your personal details) on your test portal.
  • Log out.
  • Log into your production portal.
  • Check if the information has changed. If it has changed, go through the above steps again to see what you missed. No changes should have been made!
  • If no changes have been made, good! Go back to your test portal and check that the change you made is still there ... well.

Modification of documents

  • Add a document to one of your files on your test portal.
  • Log out.
  • Log into your production portal.
  • Check if the new document is there. If it is there, go through the above steps again to see what you missed. No changes should have been made!
  • If no changes have been made, good! Go back to your test portal and check that the change you made is still there ... well.


Update

You copied everything, and your configuration protects you from unwanted changes in your production directory? Have you verified that you can access your test portal from your browser? Good! Now get the latest version of Dolibarr and copy that too dry over the other one, which is in /var/www/dolibarrtest (if asked, choose "overwrite"). Then point your browser to the test portal, and add "install/" in the URL. The Dolibarr installation/update process should offer you an update. Accept and follow the steps.

Your test portal is now updated to the latest version. Well done!