<?xml version="1.0" encoding="UTF-8" ?>
<!-- RSS generated by PHPBoost on Fri, 06 Mar 2026 09:11:17 +0100 -->
<rss version="2.0" xmlns:atom="https://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Wiki]]></title>
		<atom:link href="https://www.phpboost.com/syndication/rss/wiki/47" rel="self" type="application/rss+xml"/>
		<link>https://www.phpboost.com</link>
		<description><![CDATA[Derniers articles de la catégorie Changement d'hébergement ou de serveur]]></description>
		<copyright>(C) 2005-2026 PHPBoost</copyright>
		<language>fr</language>
		<generator>PHPBoost</generator>
		
            <item>
                <title><![CDATA[Changement d'hébergement ou de serveur]]></title>
                <link>https://www.phpboost.com/wiki/changement-d-hebergement-ou-de-serveur</link>
                <guid>https://www.phpboost.com/wiki/changement-d-hebergement-ou-de-serveur</guid>
                <description><![CDATA[<br />
<div class="formatter-container formatter-block">Ce tutoriel explique pas à pas la procédure de transfert de son site d'un serveur à un autre. Cela peut être entre deux serveurs hébergés en ligne ou entre un serveur en ligne et l'autre en local et inversement.</div><br />
<br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-transfert-des-fichiers">Transfert des fichiers</h2><br />
<br />
Transférez <strong>tous</strong> les fichiers et répertoires de votre site ("ancien site") vers son nouvel hébergement ("nouveau site").<br />
<br />
<span class="message-helper bgc warning"><strong>Une fois le transfert effectué, supprimez le fichier .htaccess situé à la racine du nouveau site.</strong></span><br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-transfert-de-la-base-de-donnees">Transfert de la base de données</h2><br />
<br />
Deux solutions distinctes s'offrent à vous:<br />
<br />
<h3 class="formatter-title wiki-paragraph-3" id="paragraph-sauvegarde-et-restauration-via-phpmyadmin">Sauvegarde et restauration via phpMyAdmin</h3><br />
<br />
phpMyAdmin (pma) est fourni par la majorité des hébergeurs et des émulateurs de serveur local.<br />
<ol class="formatter-ol">
    <li class="formatter-li"> Sauvegardez la totalité des données de l'ancien site via pma.
    </li><li class="formatter-li"> Modifiez le fichier kernel/db/config.php du nouveau site en renseignant les nouveaux identifiants de connexion.
    </li><li class="formatter-li"> Restaurez les données pour le nouveau site via pma sur la nouvelle base de donnée.<br />
</li></ol><br />
À ce stade le site est réinstallé mais vous devez maintenant appliquer la <a class="offload" href="https://www.phpboost.com/wiki/changement-d-hebergement-ou-de-serveur#paragraph-migration-du-serveur">migration du serveur</a>.<br />
<br />
<h3 class="formatter-title wiki-paragraph-3" id="paragraph-sauvegarde-et-restauration-via-le-module-base-de-donnees">Sauvegarde et restauration via le module Base de données</h3><br />
<br />
Le module Base de données (database) est fourni avec PHPBoost.<br />
<ol class="formatter-ol">
    <li class="formatter-li"> Sauvegardez la totalité des données de l'ancien site via le module Base de données.
    </li><li class="formatter-li"> Ajoutez le dossier install à votre nouveau site et installez le nouveau site.
    </li><li class="formatter-li"> Restaurez les données issues de l'ancien site sur le nouveau site via le module Base de données.<br />
</li></ol><br />
En fin de restauration vous allez être redirigé vers une page d'erreur sur l'ancien site, ce qui est normal, votre nouveau site est à ce stade installé mais avec la configuration de l'ancien. Il faut maintenant appliquer la <a class="offload" href="https://www.phpboost.com/wiki/changement-d-hebergement-ou-de-serveur#paragraph-migration-du-serveur">migration du serveur</a>.<br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-migration-du-serveur">Migration du serveur</h2><br />
<br />
Téléchargez l'archive <a class="offload" href="https://www.phpboost.com/upload/server_migration.zip">server_migration.zip</a> et placez son contenu (le fichier server_migration.php) à la racine de votre nouveau site.<br />
Pour les plus avertis, vous pouvez créer le fichier server_migration.php avec ce contenu :<br />
<div class="formatter-container formatter-code code-PHP"><span class="formatter-title">Code PHP : </span><div class="formatter-content"><pre style="display:inline;"><pre class="php" style="font-family:monospace;"><span style="color: #FF0000; font-weight: normal;"><?php</span>
<span style="color: #008000; font-style: italic;">/**
 * @copyright     © 2005-2019 PHPBoost
 * @license     https://www.gnu.org/licenses/gpl-3.0.html GNU/GPL-3.0
 * @author      Kevin MASSY <reidlos@phpboost.com>
 * @version       PHPBoost 5.2 - last update: 2019 02 19
 * @since       PHPBoost 3.0 - 2012 05 14
 * @contributor Julien BRISWALTER <j1.seth@phpboost.com>
 * @contributor Sebastien LARTIGUE <babsolune@phpboost.com>
*/</span>
<a href="http://www.php.net/define"><span style="color: #0000FF; font-weight: bold;">define</span></a><span style="color: #8000FF;">&#40;</span><span style="color: #808080;">'PATH_TO_ROOT'</span><span style="color: #8000FF;">,</span> <span style="color: #808080;">'.'</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
<span style="color: #0000FF; font-weight: bold;">require_once</span> PATH_TO_ROOT <span style="color: #8000FF;">.</span> <span style="color: #808080;">'/kernel/framework/io/data/cache/CacheData.class.php'</span><span style="color: #8000FF;">;</span>
<span style="color: #0000FF; font-weight: bold;">require_once</span> PATH_TO_ROOT <span style="color: #8000FF;">.</span> <span style="color: #808080;">'/kernel/framework/io/data/config/ConfigData.class.php'</span><span style="color: #8000FF;">;</span>
<span style="color: #0000FF; font-weight: bold;">require_once</span> PATH_TO_ROOT <span style="color: #8000FF;">.</span> <span style="color: #808080;">'/kernel/framework/io/data/config/AbstractConfigData.class.php'</span><span style="color: #8000FF;">;</span>
<span style="color: #0000FF; font-weight: bold;">require_once</span> PATH_TO_ROOT <span style="color: #8000FF;">.</span> <span style="color: #808080;">'/kernel/framework/phpboost/config/GeneralConfig.class.php'</span><span style="color: #8000FF;">;</span>
<span style="color: #0000FF; font-weight: bold;">require_once</span> PATH_TO_ROOT <span style="color: #8000FF;">.</span> <span style="color: #808080;">'/kernel/framework/helper/TextHelper.class.php'</span><span style="color: #8000FF;">;</span>
<span style="color: #0000FF; font-weight: bold;">require_once</span> PATH_TO_ROOT <span style="color: #8000FF;">.</span> <span style="color: #808080;">'/kernel/framework/util/Date.class.php'</span><span style="color: #8000FF;">;</span>
<span style="color: #000080;">$config_file</span> <span style="color: #8000FF;">=</span> PATH_TO_ROOT <span style="color: #8000FF;">.</span> <span style="color: #808080;">'/cache/CacheManager-kernel-general-config.data'</span><span style="color: #8000FF;">;</span>
<span style="color: #0000FF; font-weight: bold;">if</span> <span style="color: #8000FF;">&#40;</span><a href="http://www.php.net/file_exists"><span style="color: #0000FF; font-weight: bold;">file_exists</span></a><span style="color: #8000FF;">&#40;</span><span style="color: #000080;">$config_file</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">&#41;</span>
<span style="color: #8000FF;">&#123;</span>
    <span style="color: #000080;">$general_config</span> <span style="color: #8000FF;">=</span> TextHelper<span style="color: #8000FF;">::</span><a href="http://www.php.net/unserialize"><span style="color: #0000FF; font-weight: bold;">unserialize</span></a><span style="color: #8000FF;">&#40;</span><a href="http://www.php.net/file_get_contents"><span style="color: #0000FF; font-weight: bold;">file_get_contents</span></a><span style="color: #8000FF;">&#40;</span><span style="color: #000080;">$config_file</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
<span style="color: #8000FF;">&#125;</span>
<span style="color: #0000FF; font-weight: bold;">else</span>
<span style="color: #8000FF;">&#123;</span>
    <span style="color: #000080;">$general_config</span> <span style="color: #8000FF;">=</span> <span style="color: #0000FF; font-weight: bold;">new</span> GeneralConfig<span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
    <span style="color: #000080;">$general_config</span><span style="color: #8000FF;">-></span><span style="color: #000000;">set_default_values</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
<span style="color: #8000FF;">&#125;</span>
<span style="color: #0000FF; font-weight: bold;">if</span> <span style="color: #8000FF;">&#40;</span><a href="http://www.php.net/isset"><span style="color: #0000FF; font-weight: bold;">isset</span></a><span style="color: #8000FF;">&#40;</span><span style="color: #000080;">$_POST</span><span style="color: #8000FF;">&#91;</span><span style="color: #808080;">'url'</span><span style="color: #8000FF;">&#93;</span><span style="color: #8000FF;">&#41;</span> <span style="color: #8000FF;">&&</span> <a href="http://www.php.net/isset"><span style="color: #0000FF; font-weight: bold;">isset</span></a><span style="color: #8000FF;">&#40;</span><span style="color: #000080;">$_POST</span><span style="color: #8000FF;">&#91;</span><span style="color: #808080;">'path'</span><span style="color: #8000FF;">&#93;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">&#41;</span>
<span style="color: #8000FF;">&#123;</span>
    <span style="color: #000080;">$general_config</span><span style="color: #8000FF;">-></span><span style="color: #000000;">set_site_url</span><span style="color: #8000FF;">&#40;</span><span style="color: #000080;">$_POST</span><span style="color: #8000FF;">&#91;</span><span style="color: #808080;">'url'</span><span style="color: #8000FF;">&#93;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
    <span style="color: #000080;">$general_config</span><span style="color: #8000FF;">-></span><span style="color: #000000;">set_site_path</span><span style="color: #8000FF;">&#40;</span><span style="color: #000080;">$_POST</span><span style="color: #8000FF;">&#91;</span><span style="color: #808080;">'path'</span><span style="color: #8000FF;">&#93;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
    <a href="http://www.php.net/file_put_contents"><span style="color: #0000FF; font-weight: bold;">file_put_contents</span></a><span style="color: #8000FF;">&#40;</span><span style="color: #000080;">$config_file</span><span style="color: #8000FF;">,</span> TextHelper<span style="color: #8000FF;">::</span><a href="http://www.php.net/serialize"><span style="color: #0000FF; font-weight: bold;">serialize</span></a><span style="color: #8000FF;">&#40;</span><span style="color: #000080;">$general_config</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
    <span style="color: #0000FF; font-weight: bold;">echo</span> <span style="color: #808080;">'Success'</span><span style="color: #8000FF;">;</span>
<span style="color: #8000FF;">&#125;</span>
<span style="color: #000080;">$site_url</span> <span style="color: #8000FF;">=</span> <span style="color: #000080;">$general_config</span><span style="color: #8000FF;">-></span><span style="color: #000000;">get_site_url</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
<span style="color: #000080;">$site_path</span> <span style="color: #8000FF;">=</span> <span style="color: #000080;">$general_config</span><span style="color: #8000FF;">-></span><span style="color: #000000;">get_site_path</span><span style="color: #8000FF;">&#40;</span><span style="color: #8000FF;">&#41;</span><span style="color: #8000FF;">;</span>
<span style="color: #FF0000; font-weight: normal;">?></span>
<!DOCTYPE html>
<html lang="en">
    <head>
        <title>Server migration</title>
        <meta charset="UTF-8" />
        <meta name="generator" content="PHPBoost" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <link rel="stylesheet" href="templates/default/theme/default.css" type="text/css" media="screen, print" />
        <link rel="stylesheet" href="templates/default/theme/admin_design.css" type="text/css" media="screen, print" />
        <link rel="stylesheet" href="templates/default/theme/admin_form.css" type="text/css" media="screen, print" />
        <link rel="stylesheet" href="templates/default/theme/admin_colors.css" type="text/css" media="screen, print" />
    </head>
    <body itemscope="itemscope" itemtype="http://schema.org/WebPage">
        <form action="" method="post" class="fieldset-content">
            <fieldset>
                <legend><h1>Migration</h1></legend>
                <div class="fieldset-inset">
                    <div class="form-element half-field">
                        <label for="url">Url :&nbsp;</label>
                        <input type="text" size="55" maxlength="100" id="url" name="url" value="<span style="color: #FF0000; font-weight: normal;"><?php</span> <span style="color: #0000FF; font-weight: bold;">echo</span> <span style="color: #000080;">$site_url</span> <span style="color: #FF0000; font-weight: normal;">?></span>">
                    </div>
                    <div class="form-element half-field">
                        <label for="path">Path :&nbsp;</label>
                        <input type="text" size="55" maxlength="100" id="path" name="path" value="<span style="color: #FF0000; font-weight: normal;"><?php</span> <span style="color: #0000FF; font-weight: bold;">echo</span> <span style="color: #000080;">$site_path</span> <span style="color: #FF0000; font-weight: normal;">?></span>">
                    </div>
                </div>
            </fieldset>
            <fieldset class="fieldset-submit">
                <div class="fieldset-inset">
                    <button class="submit" type="submit" name="submit" value="true">Submit</button>
                </div>
            </fieldset>
        </form>
    </body>
</html>
&nbsp;</pre></pre></div></div><br />
<br />
Dans la barre d'adresse du navigateur, entrez l'adresse du nouveau site et rajoutez à la fin <em>server_migration.php</em>:<br />
<div id="" class="question" style="display:inline-block"> <pre style="display:inline;">www.monnouveausite.ext/server_migration.php</pre></div><br />
<strong>Attention</strong> si PHPBoost est dans un dossier, ce sera:<br />
<div id="" class="question" style="display:inline-block"><pre style="display:inline;">www.monnouveausite.ext/dossier/server_migration.php</pre></div><br />
<br />
Après avoir rentré l'adresse, vous tomberez sur :<br />
<img src="https://resources.phpboost.com/documentation/installation/migration/migration.jpg" alt="migration" /><br />
<br />
Les champs apparaissent en étant déjà renseignés avec les infos de l'ancien site.<br />
<ul class="formatter-ul">
    <li class="formatter-li"> Modifiez le champ URL avec la nouvelle adresse de votre site: <div id="" class="question" style="display:inline-block"><pre style="display:inline;">http(s)://www.monouveausite.ext</pre></div>
    </li><li class="formatter-li"> Modifiez le champ Path correspondant à l'emplacement qu'aura PHPBoost sur votre hébergement:<ul class="formatter-ul">
    <li class="formatter-li"> <div id="" class="question" style="display:inline-block"><pre style="display:inline;">/</pre></div> si phpboost est à la racine du site.
    </li><li class="formatter-li"><div id="" class="question" style="display:inline-block"><pre style="display:inline;">/chemin/vers/phpboost</pre></div> s'il est dans un sous-dossier du site.<br />
</li></ul><br />
</li></ul><br />
<span class="message-helper bgc warning">Sur un hébergement en ligne, il faudra impérativement supprimer le fichier <em>server_migration.php</em> après la migration, pour des raisons de sécurité !</span><br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-ajustement-de-la-configuration-du-nouveau-site">Ajustement de la configuration du nouveau site</h2><br />
<br />
Votre nouveau site est quasiment opérationnel. Il faut maintenant pérenniser le changement que nous venons de faire en le validant dans la base de données.<br />
Dans le panneau d'administration du site, allez dans <pre style="display:inline;">Administration->Configuration->Configuration avancée</pre><br />
<ul class="formatter-ul">
    <li class="formatter-li"> Vérifiez que l'adresse et le chemin du site sont les bons, sinon modifiez-les.
    </li><li class="formatter-li"> Modifiez les informations de <pre style="display:inline;">Contenu du fichier .htaccess</pre> s'il en existe.
    </li><li class="formatter-li"> Cliquez sur <pre style="display:inline;">envoyer</pre> de façon à enregistrer en base de données les nouvelles informations.<br />
</li></ul><br />
<br />
<h2 class="formatter-title wiki-paragraph-2" id="paragraph-regeneration-globale-du-cache">Régénération globale du cache</h2><br />
<br />
Il est recommandé de régénérer l'ensemble du cache, même si ce n'est pas obligatoire. Pour cela, il faut aller dans le panneau d'administration <pre style="display:inline;">Outils->Cache</pre>, puis cliquez sur <pre style="display:inline;">vider</pre>.<br />
<br />
Voilà, votre site devrait être transféré correctement. Si vous rencontrez des difficultés, n'hésitez pas à demander de l'aide sur le forum de support.]]></description>
                <pubDate>Wed, 13 May 2020 17:49:50 +0200</pubDate>
                
            </item>
		
	</channel>
</rss>
