As long as the site remains within the SPIP guidelines, it is as easy to transfer a SPIP site as it is to install it.
Before starting
Before starting, you should also make sure that you have :
- a SPIP administrator account,
- a configured or configurable FTP client,
- FTP access data for the old and new hostings (URL, login and password for each)
- the database access data for the old and new hostings (URL or localhost; login and password for each)
Preparing the site
Warning!
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 it on the site itself, for example using the plug-in "Under construction" or "Emergency alert".
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 [1].
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 [2].
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
On the original site
- Empty the site’s cache (to avoid retrieving too many useless files)
- A backup of the database (dump).
- With the FTP client, download all the files and folders
On the new site
- Place all previous files and folders.
- Delete the database connection file
config/connect.php
to force reinstallation of the site. - 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 [3] installed on the site that you want to relocate.
On the original site
You need to retrieve the data:
- The database which can be exported from phpMyAdmin for example.
- -* the entire contents of the
IMG/
folder, which contains images and attachments from the site. - Since SPIP 4.0, it is also necessary to retrieve the
config/cles.php
file which contains the site’s cryptographic keys
On the new site
- Install the "empty" SPIP in the same version
- Place the files from the old site, respecting the positions of the folders
- Import the database of the old site via phpmyadmin of the new site
- Connect to the private area. Go to the site configuration menu and modify the main URL of the site.
- Possibly empty the site’s cache
From this point on, you should be able to see the content of your site with the templates of the SPIP distribution. All that remains is to retrieve the personalization of the SPIP site.
You have to retrieve from the old hosting and put in the new one:
the templates: as explained here, depending on the version of SPIP, they will be :
- or in the
templates
folder, - or in the custom folder whose name is defined in
my_options.php
. - or in the form of a plugin that must be reactivated in the configuration menu, plugins section
personal filters and options:
-
mes_fonctions.php
-
config/mes_options.php
additional plugins and libraries
placed in the /plugins
et /lib
directories.
You will also need to make the same adjustments in the private area as you did when you moved by copying all the files.
That’s it. If your site does not have any exotic extensions or modules, that’s it!
Recalculate your pages and you should see your site moved.