227
edits
(translate use your sata to test last version) Tag: 2017 source edit |
No edit summary Tag: 2017 source edit |
||
| Line 33: | Line 33: | ||
* Backup your database: | * Backup your database: | ||
<source lang="bash"> | <source lang="bash"> | ||
mysqldump -u utilisateur -p --result-file=dolibarr.date.sql | mysqldump -u utilisateur -p --result-file=dolibarr.date.sql database | ||
</source> | </source> | ||
* | * 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. | ||
<source lang="bash"> | <source lang="bash"> | ||
mysqladmin -u | mysqladmin -u user -p drop test_database | ||
mysqladmin -u | mysqladmin -u user -p create test_database | ||
</source> | </source> | ||
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 | * Importez les données de votre base de départ dans votre nouvelle base | ||
<source lang="bash"> | <source lang="bash"> | ||
mysql -u | mysql -u user -p test_database < dolibarr.date.sql | ||
</source> | </source> | ||
== | == 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'': | |||
<code> | <code> | ||
<VirtualHost *:80> | <VirtualHost *:80> | ||
ServerName dolibarr. | ServerName dolibarr.mydomain.net | ||
ServerAdmin webmaster@ | ServerAdmin webmaster@mydomain.net | ||
DocumentRoot /var/www/dolibarr/htdocs | DocumentRoot /var/www/dolibarr/htdocs | ||
DirectoryIndex index.php | DirectoryIndex index.php | ||
| Line 60: | Line 60: | ||
</VirtualHost> | </VirtualHost> | ||
</code> | </code> | ||
... | ... it will now be necessary to make a copy in, for example, ''/etc/apache2/sites-available/dolibarrtest'': | ||
<code> | <code> | ||
<VirtualHost *:80> | <VirtualHost *:80> | ||
ServerName dolibarrtest. | ServerName dolibarrtest.mydomain.net | ||
ServerAdmin webmaster@ | ServerAdmin webmaster@mydomain.net | ||
DocumentRoot /var/www/dolibarrtest/htdocs | DocumentRoot /var/www/dolibarrtest/htdocs | ||
DirectoryIndex index.php | DirectoryIndex index.php | ||
| Line 72: | Line 72: | ||
</code> | </code> | ||
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'' | ||
<code> | <code> | ||
ln -s /etc/apache2/sites-enabled/dolibarrtest /etc/apache2/sites-available/dolibarrtest | ln -s /etc/apache2/sites-enabled/dolibarrtest /etc/apache2/sites-available/dolibarrtest | ||
</code> | </code> | ||
* | * reload the Apache2 config | ||
<code> | <code> | ||
/etc/init.d/apache2 reload | /etc/init.d/apache2 reload | ||