[ar] [ast] [bg] [br] [ca] [co] [cpf] [cs] [da] [de] [en] [eo] [es] [eu] [fa] [fon] [fr] [gl] [id] [it] [ja] [lb] [nl] [oc] [pl] [pt] [ro] [ru] [sk] [sv] [tr] [uk] [vi] [zh] Espace de traduction


Moving a SPIP site

June 2010 — updated on : June 2015

All the versions of this article:

Changing the hosting provider of a SPIP site is almost as simple as installing it. The only additions are recovering the database and any personalisation that has been made to the SPIP installation.

Nonetheless, it is important to know if the site has not undergone any such customisation, particularly "non-SPIP" components that must be retrieved, and to know how to modify the previous configuration to work with the new hosting provider.

It is often the case that a site is started "locally" or with a hosting provider that is free but with limited facilities, and then at a later time change to a new hosting provider when it becomes necessary. Or it may quite simply be that you’re being prudent and wish to regularly make full restorable backups of your site.

So long as the site follows a certain number of simple rules, remaining within the framework of a SPIP site [1], then it should be a relatively simple matter to retrieve a SPIP site. This can be done in a manner similar to installing it without any additional technical mumbo-jumbo.

Before starting

Explicitly, it will be easy to retrieve from a site:
-  everything that has been entered the SPIP’s private zone interface by creating sections, articles, news items, syndicated sites, and including any attached documents or images. ;
-  any SPIP customisations made by building template files, including basic PHP alterations.

This task might be more complicated if:
-  the site has extensions or uses non-SPIP modules, for example in PHP. It is particularly important to know if these extensions use other tables or databases and if/where/how these needs to be configured to be usable at the new hosting site.
-  you have modified the SPIP kernel itself or one of its extensions, e.g. fiddling around with content from SPIP-contrib

Before starting, you must be absolutely sure that you know the following data:
-  an administrator’s account for the SPIP site,
-  a configured or configurable FTP client programme,
-  the old and new FTP connection credentials (URL, login and password for each of them)
-  connection credentials to the old and new databases (URL or localhost; login and password for each of them)

Preparing the site


If your site has a lot of activity, it is better to avoid having any new contributions added while you are moving the site. SPIP does not have a specific mechanism to do this, but you can already do the following (and preferably several days before you move):
-  advise all authors by email, if you have maintained a lost of them,
-  issue a general post to SPIP’s internal messaging system,
-  possibly publish the notice on the site itself.

Of course, it is always possible, once the site has been moved, to check in the calendar of the site and the follow-up sections of the old site’^s forums to see if there have been any new contributions, and to restart the export / import process again, but only once the new site is ready and then only for the data itself. But if there have been contributions made to the new site during this time, then you run into real problems: you will need to choose between one set of data and the other [2].

We do not tackle here the considerations that need to be taken in respect of the site’s URL, specifically if any a local DNS record needs to be reconfigured or if a remote one needs to be forwarded. In the first case, you absolutely must find a ways to warn your users. A good idea is to expect a common period of coexistence of the two URLs and to post a message warning of the relocation and an automatic redirection to the new site as soon as it is ready. In the second case, if you want to retain the name of the domain, then you must make modifications to the DNS records, which is a delicate matter indeed as it may require 48 hours or more to propagate the DNS record changes [3].

Empty the cache before making a backup copy of the database. This procedure id explained in this article: «Backing up your data».

There are two ways to generate the new site

We can distinguish two different ways to move the site:
-  the first consists of downloading all of the files from the old hosting provider to your own computer, and then uploading them all to the new one, followed by reconfiguring SPIP a little to work on the new system,
-  the second consists of only retrieving the data and customisations of your SPIP site, installing a new SPIP from scratch at the new hosting provider, and using that new site to upload the data and customisations.

The first solution is a priori a simpler matter, but transferring all of the SPIP archives is useless and could be a considerable waste of your time. The second is more elegant, and provides the webmaster the opportunity to "clean up" the code of a site and only retrieve what is actually useful.

Option 1: downloading all the files

-  Using the FTP client, download all of the files and folders to your local machine, making sure you do so from the "root" of the site and that you maintain the hierarchical structure of the folders,

-  on the local copy on your computer, delete the inc_connect.php3 file which is located in the ecrire/ directory,

-  upload everything using FTP to your new hosting provider,

-  use a browser to open the ecrire/ directory of your new hoster and complete the last phase of the SPIP installation process. At this step, it will be necessary to provide the connection credentials to the database at the new host, and it may also be necessary for you to alter some of the SPIP directory access rights.

-  Go in to the private zone using the administrator account that you have just created and open the menus for " Site configuration", "Site maintenance" so you can run the "Restore database" routine, and that should be all.

It’s useful here to note that the administrator account that you have just created in SPIP is lost as soon as the full database is imported. At that time, you will need to use the accounts that existed on the old site before it was backed up and copied.

-  There remain a couple of points to check and reconfigure on the new site, in particular:

  • checking the character site, if you modified it from the SPIP default and you see some "hieroglyphics" appearing on your public site,
  • define the (new) URL address for the site, the name of the site and the email address of the webmaster on the site configuration administration page,
  • check the other settings, such as language availability and interactivity parameters.

Option 2: only retrieve the data and customisations

You must first identify exactly what version of SPIP you are using [4] installed on the site that you want to relocate.

-  Install exactly the same version of SPIP to the new hosting provider, as detailed in "Installing SPIP".

-  Start with the data. From the old hosting provider, you must have retrieved:

  • the ecrire/data/dump.xml.gz backup file that you have just created,
  • all the contents of the IMG/ folder, which contains the images and documents attached to the site.

-  upload them all to the new hosting provider, copying them into the same directories as they were before.

-  Enter the private zone of the site with the administrator account that you just created when you installing the fresh SPIP site, and use the menus for "Site configuration", "Site maintenance" to run the "REstore the database" routine.

Once completed, you will be able to see the content of your site but using the default template’s provided with the standard SPIP distribution. All that’s left is to restore the customisations of the SPIP site. This requires retrieving the following items from the old hosting provider and copying them to the correct folders on the new hosting provider:

-  personal filters and options: i.e. the mes_fonctions.php3 and ecrire/mes_options.php3 files

-  the templates: as explained here, depending on your version of SPIP, they will be either in the squelettes folder or in the folder name in the mes_fonctions.php3 file with the $dossier_squelettes variable, or they may be directly at the root of the site. In all cases, you should not forget the squelette.php3 files which are called directly and which are found at the site root.

NOTE: this is no longer the case for recent versions of SPIP - please consult the article describing your version of SPIP to find out where the template files may be stored.

You must also make the same adjustments in the private zone when copying all of the files.

That’s it!. If your site does not use any exotic extensions or modules, you should be done! Recalculate your pages and you should see your site completely relocated at the new hosting provider. If you’re still uncertain where your site is currently running, try creating a PHPINFO.PHP file so you can see the local environment where your site is running.


[1or combined without other modules, well-architected, and particularly well documented!!

[2that of the old site or that of the new site, each of which has changes since the first data backup/transfer was made.

[3This is beyond the scope of this document, but the Internet has a great many discussions on the details relating to HTML or PHP redirection as it does for modifications and propagations of the DNS data, suitable in one form or another for any level of web expertise.

[4The SPIP version number is indicated on all pages of the private zone, lower right hand corner. And all version of SPIP are available in the archives.

Show the template of this page Site powered by SPIP | Translation area | Private area