J4.x

CLI Database Exporter Importer/fr: Difference between revisions

From Joomla! Documentation

Created page with "Se connecter à votre hébergeur et aller au dossier racine de votre site.<br /> Je recommande d'utiliser le dossier 'tmp' de Joomla dans votre chemin <folder_path> pour avoir..."
Created page with "Liste toutes les commandes disponibles de la Console Joomla:<br /><tt>php cli/joomla.php list</tt>"
Line 14: Line 14:
Je recommande d'utiliser le dossier 'tmp' de Joomla dans votre chemin <folder_path> pour avoir les autorisations en lecture/écriture.
Je recommande d'utiliser le dossier 'tmp' de Joomla dans votre chemin <folder_path> pour avoir les autorisations en lecture/écriture.


* List all available commands of the Joomla Console:<br /><tt>php cli/joomla.php list</tt>
* Liste toutes les commandes disponibles de la Console Joomla:<br /><tt>php cli/joomla.php list</tt>
* Export the database to the folder:<br /><tt>php cli/joomla.php database:export --all --folder <folder_path></tt>
* Export the database to the folder:<br /><tt>php cli/joomla.php database:export --all --folder <folder_path></tt>
* Import the database from folder:<br /><tt>php cli/joomla.php database:import --all --folder <folder_path></tt>
* Import the database from folder:<br /><tt>php cli/joomla.php database:import --all --folder <folder_path></tt>

Revision as of 12:59, 9 June 2019

Joomla! 
4.0

À propos

Avant de mettre à jour Joomla! ou d'installer une extension tierce, il est fortement recommandé de sauvegarder votre site.
La Console Joomla! 4.x fournit des commandes pour exporter (sauvegarder) et importer (restaurer) votre base de données Joomla!.

Pré-requis

Pour utiliser ces commandes, vous avez besoin d'un accès via un shell sécurisé (SSH) à votre hébergeur auquel PHP CLI (interface en ligne de commande) est installé. Prenez en considération d'avoir quelques connaissances élémentaires d'usage des commandes shell.

Instructions

Se connecter à votre hébergeur et aller au dossier racine de votre site.
Je recommande d'utiliser le dossier 'tmp' de Joomla dans votre chemin <folder_path> pour avoir les autorisations en lecture/écriture.

  • Liste toutes les commandes disponibles de la Console Joomla:
    php cli/joomla.php list
  • Export the database to the folder:
    php cli/joomla.php database:export --all --folder <folder_path>
  • Import the database from folder:
    php cli/joomla.php database:import --all --folder <folder_path>

You can also:

  • Export the database in a zip file:
    php cli/joomla.php database:export --all --zip
  • Export a table:
    php cli/joomla.php database:export --table <table_name>
  • Export a table as a .zip file:
    php cli/joomla.php database:export --table <table_name> --zip
  • Import a table:
    php cli/joomla.php database:import --table <table_name>
  • If you need help:
    php cli/joomla.php database:export --help php cli/joomla.php database:import --help

Back up and restore

To make a full backup (with folders, files and database) of your site, you can execute these commands:

  1. Archive your Joomla root directory:
    tar --exclude='./tmp/joomla_bak.*' -zcvf tmp/joomla_bak.tgz . > tmp/joomla_bak.log
  2. Export all the Joomla database:
    php cli/joomla.php database:export --all --folder tmp/db_bak

And to restore it, execute these commands:

  1. Import all the Joomla database:
    php cli/joomla.php database:import --all --folder tmp/db_bak
  2. Extract the archive:
    tar --recursive-unlink -xvf tmp/joomla_bak.tgz .